Commit 87327137 authored by Shawn Smith's avatar Shawn Smith Committed by Dave Cheney

encoding/hex: add Decode test case with uppercase hex characters

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/46270043
parent 592416a3
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment