We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b55a6c4 commit bd6ebbdCopy full SHA for bd6ebbd
internal/mbtest/helper.go
@@ -22,9 +22,11 @@ func Testdata(t *testing.T, relativePath string) []byte {
22
return b
23
}
24
25
-// AssertTestdata gets testdata and asserts it equals actual.
+// AssertTestdata gets testdata and asserts it equals actual. We start by
26
+// slicing off all leading and trailing white space, as defined by Unicode.
27
func AssertTestdata(t *testing.T, relativePath string, actual []byte) {
- expected := Testdata(t, relativePath)
28
+ expected := bytes.TrimSpace(Testdata(t, relativePath))
29
+ actual = bytes.TrimSpace(actual)
30
31
if !bytes.Equal(expected, actual) {
32
t.Fatalf("expected %s, got %s", expected, actual)
0 commit comments