matryer / is

Professional lightweight testing mini-framework for Go.
MIT License
1.77k stars 58 forks source link

Lines should be escaped before printing #27

Closed bbrks closed 5 years ago

bbrks commented 5 years ago

The following test produces an incorrect message when failing, as the lines passed to decorate() are not being escaped before being passed into log()'s Sprintf().

func TestFormatStringEscape(t *testing.T) {
    is := New(t)
    is.Equal("20% VAT", "0.2 VAT")
}
=== RUN   TestFormatStringEscape
    is_test.go:296: 20%!V(MISSING)AT != 0.2 VAT
--- FAIL: TestFormatStringEscape (0.00s)