aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/encoding
diff options
context:
space:
mode:
authorShawn Smith <shawn.p.smith@gmail.com>2014-01-01 16:32:05 +1100
committerDave Cheney <dave@cheney.net>2014-01-01 16:32:05 +1100
commit873271378b835b402b011792b35ad7bb7b6f4a89 (patch)
treea987a459d8f55bc8db2de385a84f24b1dbbd6ee9 /src/pkg/encoding
parent592416a3878d88684ff3817cfb9292c96ee14baa (diff)
downloadgo-873271378b835b402b011792b35ad7bb7b6f4a89.tar.xz
encoding/hex: add Decode test case with uppercase hex characters
R=golang-codereviews, dave CC=golang-codereviews https://golang.org/cl/46270043
Diffstat (limited to 'src/pkg/encoding')
-rw-r--r--src/pkg/encoding/hex/hex_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pkg/encoding/hex/hex_test.go b/src/pkg/encoding/hex/hex_test.go
index 356f590f02..cef4ef41b7 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 {