diff options
author | Mark Ryan <mark.d.ryan@intel.com> | 2017-06-15 11:22:48 +0100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-06-15 16:11:28 +0000 |
commit | 34ab42111cc989a2951134ef12c0e71888d41270 (patch) | |
tree | bb9259cf490d2c9424c53eebbd0906e1f881d9c4 /src/encoding/base32 | |
parent | 023593d0a858e31d9cf67c6c08ad3f6a7a9e842a (diff) | |
download | go-34ab42111cc989a2951134ef12c0e71888d41270.tar.gz go-34ab42111cc989a2951134ef12c0e71888d41270.zip |
encoding: report correct line numbers in tests
Some of the _test.go files in the encoding packages contain a private
function called testEqual that calls testing.Errorf if the arguments
passed to it are unequal. The line numbers output by such calls to
Errorf identify the failure as being in testEqual itself which is not
very useful. This commit fixes the problem by adding a call to the
new t.Helper method in each of the testEqual functions. The line
numbers output when errors do occur now identify the real source of
the error.
Change-Id: I582d1934f40ef2b788116c3811074c67ea882021
Reviewed-on: https://go-review.googlesource.com/45871
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/encoding/base32')
-rw-r--r-- | src/encoding/base32/base32_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/encoding/base32/base32_test.go b/src/encoding/base32/base32_test.go index bd101b5b04..12256d08ee 100644 --- a/src/encoding/base32/base32_test.go +++ b/src/encoding/base32/base32_test.go @@ -44,6 +44,7 @@ var bigtest = testpair{ } func testEqual(t *testing.T, msg string, args ...interface{}) bool { + t.Helper() if args[len(args)-2] != args[len(args)-1] { t.Errorf(msg, args...) return false |