From 51cd27a889a0135e59644c4f50213af06da3d1a6 Mon Sep 17 00:00:00 2001 From: ac7 Date: Mon, 3 Nov 2014 10:26:29 -0600 Subject: [PATCH] Wrap NoError message with quote marks Previous behavior was to print the error with no delimiters: No error is expected but got unexpected character in stream New behavior is to print the error surrounded by quotes: Recieved unexpected error "unexpected character in stream" --- assert/assertions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assert/assertions.go b/assert/assertions.go index 5de1ab1..61a5c77 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -695,7 +695,7 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { return true } - return Fail(t, fmt.Sprintf("No error is expected but got %v", err), msgAndArgs...) + return Fail(t, fmt.Sprintf("Received unexpected error %q", err), msgAndArgs...) } // Error asserts that a function returned an error (i.e. not `nil`).