Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines should be escaped before printing #27

Closed
bbrks opened this issue May 7, 2019 · 0 comments · Fixed by #28
Closed

Lines should be escaped before printing #27

bbrks opened this issue May 7, 2019 · 0 comments · Fixed by #28

Comments

@bbrks
Copy link
Contributor

bbrks commented May 7, 2019

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)
bbrks added a commit to bbrks/is that referenced this issue May 7, 2019
bbrks added a commit to bbrks/is that referenced this issue May 7, 2019
matryer added a commit that referenced this issue Jul 10, 2019
 #27: Escape '%' runes in lines before formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant