Skip to content

Commit 8b65db6

Browse files
committed
Merge pull request #32 from pendo-io/human-readable-test-errors
Made failing tests print more human-readable errors
2 parents 4e2b598 + 843a163 commit 8b65db6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

parser_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,12 @@ func runTests(t *testing.T, tests []Test, runner func(Test) (interface{}, int, e
437437
}
438438

439439
if ok, expected := typeChecker(test, value); !ok {
440+
if expectedBytes, ok := expected.([]byte); ok {
441+
expected = string(expectedBytes)
442+
}
443+
if valueBytes, ok := value.([]byte); ok {
444+
value = string(valueBytes)
445+
}
440446
t.Errorf("Test '%s' expected to return value %v, but did returned %v instead", test.desc, expected, value)
441447
}
442448
}

0 commit comments

Comments
 (0)