diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/encoding/hex/hex_test.go | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-upstream/1.3.tar.gz |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/encoding/hex/hex_test.go')
-rw-r--r-- | src/pkg/encoding/hex/hex_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pkg/encoding/hex/hex_test.go b/src/pkg/encoding/hex/hex_test.go index 356f590f0..b969636cd 100644 --- a/src/pkg/encoding/hex/hex_test.go +++ b/src/pkg/encoding/hex/hex_test.go @@ -38,7 +38,10 @@ func TestEncode(t *testing.T) { } func TestDecode(t *testing.T) { - for i, test := range encDecTests { + // Case for decoding uppercase hex characters, since + // Encode always uses lowercase. + decTests := append(encDecTests, encDecTest{"F8F9FAFBFCFDFEFF", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}}) + for i, test := range decTests { dst := make([]byte, DecodedLen(len(test.enc))) n, err := Decode(dst, []byte(test.enc)) if err != nil { @@ -79,6 +82,7 @@ type errTest struct { var errTests = []errTest{ {"0", "encoding/hex: odd length hex string"}, {"0g", "encoding/hex: invalid byte: U+0067 'g'"}, + {"00gg", "encoding/hex: invalid byte: U+0067 'g'"}, {"0\x01", "encoding/hex: invalid byte: U+0001"}, } |