@@ -116,7 +116,6 @@ func TestParseMD5(t *testing.T) {
116116 label string
117117 in string
118118 out []byte
119- err string
120119 }{
121120 {
122121 label : "valid md5" ,
@@ -126,12 +125,10 @@ func TestParseMD5(t *testing.T) {
126125 {
127126 label : "invalid hex string" ,
128127 in : "not-a-hex-string" ,
129- err : "decode hex MD5 string: not-a-hex-string: encoding/hex: invalid byte: U+006E 'n'" ,
130128 },
131129 {
132130 label : "odd length hex string" ,
133131 in : "abc" ,
134- err : "decode hex MD5 string: abc: encoding/hex: odd length hex string" ,
135132 },
136133 {
137134 label : "empty string" ,
@@ -146,7 +143,6 @@ func TestParseMD5(t *testing.T) {
146143 {
147144 label : "invalid hex string with quotes" ,
148145 in : "\" not-a-hex-string\" " ,
149- err : "decode hex MD5 string: \" not-a-hex-string\" : encoding/hex: invalid byte: U+006E 'n'" ,
150146 },
151147 {
152148 label : "only quotes" ,
@@ -155,14 +151,8 @@ func TestParseMD5(t *testing.T) {
155151 },
156152 } {
157153 t .Run (tc .label , func (t * testing.T ) {
158- out , err := ParseMD5 (tc .in )
159- if tc .err != "" {
160- testutil .Assert (t , err .Error () == tc .err , fmt .Sprintf ("error message mismatch: %s != %s" , err .Error (), tc .err ))
161- testutil .Assert (t , out == nil , "output should be nil" )
162- } else {
163- testutil .Ok (t , err )
164- testutil .Assert (t , bytes .Equal (out , tc .out ), fmt .Sprintf ("output mismatch: %v != %v" , out , tc .out ))
165- }
154+ out := ParseMD5 (tc .in )
155+ testutil .Assert (t , bytes .Equal (out , tc .out ), fmt .Sprintf ("output mismatch: %v != %v" , out , tc .out ))
166156 })
167157 }
168158}
0 commit comments