5757		{uint64 (0x1122334455667788 ), "0x1122334455667788" },
5858	}
5959
60- 	encodeUint16Tests  =  []marshalTest {
61- 		{uint16 (0 ), "0x0" },
62- 		{uint16 (1 ), "0x1" },
63- 		{uint16 (0xff ), "0xff" },
64- 		{uint16 (0x1122 ), "0x1122" },
65- 	}
66- 
6760	encodeUintTests  =  []marshalTest {
6861		{uint (0 ), "0x0" },
6962		{uint (1 ), "0x1" },
@@ -141,24 +134,6 @@ var (
141134		{input : `0xbbb` , want : uint64 (0xbbb )},
142135		{input : `0xffffffffffffffff` , want : uint64 (0xffffffffffffffff )},
143136	}
144- 
145- 	decodeUint16Tests  =  []unmarshalTest {
146- 		// invalid 
147- 		{input : `0` , wantErr : ErrMissingPrefix },
148- 		{input : `0x` , wantErr : ErrEmptyNumber },
149- 		{input : `0x01` , wantErr : ErrLeadingZero },
150- 		{input : `0xfffff` , wantErr : ErrUint16Range },
151- 		{input : `0xz1` , wantErr : ErrSyntax },
152- 		// valid 
153- 		{input : `0x0` , want : uint16 (0 )},
154- 		{input : `0x2` , want : uint16 (0x2 )},
155- 		{input : `0x2F2` , want : uint16 (0x2f2 )},
156- 		{input : `0X2F2` , want : uint16 (0x2f2 )},
157- 		{input : `0xff` , want : uint16 (0xff )},
158- 		{input : `0x12af` , want : uint16 (0x12af )},
159- 		{input : `0xbbb` , want : uint16 (0xbbb )},
160- 		{input : `0xffff` , want : uint16 (0xffff )},
161- 	}
162137)
163138
164139func  TestEncode (t  * testing.T ) {
@@ -214,15 +189,6 @@ func TestEncodeUint64(t *testing.T) {
214189	}
215190}
216191
217- func  TestEncodeUint16 (t  * testing.T ) {
218- 	for  _ , test  :=  range  encodeUint16Tests  {
219- 		enc  :=  EncodeUint16 (test .input .(uint16 ))
220- 		if  enc  !=  test .want  {
221- 			t .Errorf ("input %x: wrong encoding %s" , test .input , enc )
222- 		}
223- 	}
224- }
225- 
226192func  TestDecodeUint64 (t  * testing.T ) {
227193	for  _ , test  :=  range  decodeUint64Tests  {
228194		dec , err  :=  DecodeUint64 (test .input )
@@ -236,19 +202,6 @@ func TestDecodeUint64(t *testing.T) {
236202	}
237203}
238204
239- func  TestDecodeUint16 (t  * testing.T ) {
240- 	for  _ , test  :=  range  decodeUint16Tests  {
241- 		dec , err  :=  DecodeUint16 (test .input )
242- 		if  ! checkError (t , test .input , err , test .wantErr ) {
243- 			continue 
244- 		}
245- 		if  dec  !=  test .want .(uint16 ) {
246- 			t .Errorf ("input %s: value mismatch: got %x, want %x" , test .input , dec , test .want )
247- 			continue 
248- 		}
249- 	}
250- }
251- 
252205func  BenchmarkEncodeBig (b  * testing.B ) {
253206	for  _ , bench  :=  range  encodeBigTests  {
254207		b .Run (bench .want , func (b  * testing.B ) {
0 commit comments