Skip to content

Commit 83b5580

Browse files
committed
css: pretty-print test failures
1 parent 2b8883c commit 83b5580

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

internal/css_printer/css_printer_test.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ import (
88
"github.com/evanw/esbuild/internal/test"
99
)
1010

11-
func assertEqual(t *testing.T, a interface{}, b interface{}) {
12-
t.Helper()
13-
if a != b {
14-
t.Fatalf("%s != %s", a, b)
15-
}
16-
}
17-
1811
func expectPrintedCommon(t *testing.T, name string, contents string, expected string, options Options) {
1912
t.Helper()
2013
t.Run(name, func(t *testing.T) {
@@ -30,9 +23,9 @@ func expectPrintedCommon(t *testing.T, name string, contents string, expected st
3023
text += msg.String(logger.OutputOptions{}, logger.TerminalInfo{})
3124
}
3225
}
33-
assertEqual(t, text, "")
26+
test.AssertEqualWithDiff(t, text, "")
3427
result := Print(tree, options)
35-
assertEqual(t, string(result.CSS), expected)
28+
test.AssertEqualWithDiff(t, string(result.CSS), expected)
3629
})
3730
}
3831

@@ -61,7 +54,7 @@ func expectPrintedString(t *testing.T, stringValue string, expected string) {
6154
t.Helper()
6255
p := printer{}
6356
p.printQuoted(stringValue)
64-
assertEqual(t, string(p.css), expected)
57+
test.AssertEqualWithDiff(t, string(p.css), expected)
6558
})
6659
}
6760

0 commit comments

Comments
 (0)