Skip to content

Commit

Permalink
fix broken test in assert lib
Browse files Browse the repository at this point in the history
  • Loading branch information
braydonk committed Sep 8, 2023
1 parent d9bce2f commit 92e4a8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/assert/assert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ func TestSliceEqualFailDiffSize(t *testing.T) {

func TestSliceEqualMismatch(t *testing.T) {
testInstance := newTMock()
failSizeMsg := "%v and %v"
failMismatchMsg := "at index %v: %v and %v"
expected := []int{1, 2, 4}
got := []int{1, 2, 3}
assert.SliceEqualMsg(testInstance, expected, got, failSizeMsg, "something else")
assert.SliceEqualMsg(testInstance, expected, got, "something else", failMismatchMsg)
if len(testInstance.logs) != 1 {
t.Fatalf("Found %d logs. %v", len(testInstance.logs), testInstance.logs)
}
expectedFailLog := fmt.Sprintf(failSizeMsg, expected[2], got[2])
expectedFailLog := fmt.Sprintf(failMismatchMsg, 2, expected[2], got[2])
if testInstance.logs[0] != expectedFailLog {
t.Fatalf(
"Failure log didn't match.\nexpected: %s\ngot: %s",
Expand Down

0 comments on commit 92e4a8f

Please sign in to comment.