]> Cypherpunks repositories - gostls13.git/commit
encoding/hex: improve tests
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sun, 13 Aug 2017 16:40:49 +0000 (22:10 +0530)
committerIan Lance Taylor <iant@golang.org>
Mon, 14 Aug 2017 04:45:52 +0000 (04:45 +0000)
commit98276d6abe97e50b2740e78a2b1e768abe6c7a33
treeecb47af0dcf3c027a49606281eefd68ccc3006ad
parent5d14ac74f614631a38be95cc9724ff38068c6c76
encoding/hex: improve tests

The tests for error scenarios were done by manually checking
error strings. Improved them by checking the actual error type
instead of just the string.

Printing the actual error in case of failure instead of a
generic string.

Also added a new scenario with both an invalid byte and an
invalid length string to verify that the length is checked first
before doing any computation.

Change-Id: Ic2a19a6d6058912632d597590186ee2d8348cb45
Reviewed-on: https://go-review.googlesource.com/55256
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/hex/hex_test.go