@@ -1093,21 +1093,7 @@ func FuzzParseRFC3339(f *testing.F) {
10931093}
10941094
10951095func TestAppendIntWidth (t * testing.T ) {
1096- values := []int {0 , - 1 , 1 , 10 , - 10 , 99 , - 99 }
1097- for _ , v := range values {
1098- exp := AppendInt (nil , v , 2 )
1099- got := AppendIntWidth2 (nil , v )
1100- if ! bytes .Equal (got , exp ) {
1101- t .Errorf ("AppendIntWidth2(%d) = %s, want %s" , v , got , exp )
1102- }
1103- }
1104-
1105- got := AppendIntWidth2 (nil , 199 )
1106- if ! bytes .Equal (got , []byte ("99" )) {
1107- t .Errorf ("AppendIntWidth2(199) = %s, want %s" , got , []byte ("99" ))
1108- }
1109-
1110- values = append (values , 9999 , - 9999 , 10001 )
1096+ values := []int {0 , - 1 , 1 , 10 , - 10 , 99 , - 99 , 9999 , - 9999 , 10001 }
11111097 for _ , v := range values {
11121098 exp := AppendInt (nil , v , 4 )
11131099 got := AppendIntWidth4 (nil , v )
@@ -1117,23 +1103,6 @@ func TestAppendIntWidth(t *testing.T) {
11171103 }
11181104}
11191105
1120- func BenchmarkAppendIntWidth2 (b * testing.B ) {
1121- b .Run ("name=AppendInt" , func (b * testing.B ) {
1122- var buf = make ([]byte , 0 , 8 )
1123- b .ResetTimer ()
1124- for i := 0 ; i < b .N ; i ++ {
1125- buf = AppendInt (buf [:0 ], 36 , 2 )
1126- }
1127- })
1128- b .Run ("name=AppendIntWidth2" , func (b * testing.B ) {
1129- var buf = make ([]byte , 0 , 8 )
1130- b .ResetTimer ()
1131- for i := 0 ; i < b .N ; i ++ {
1132- buf = AppendIntWidth2 (buf [:0 ], 36 )
1133- }
1134- })
1135- }
1136-
11371106func BenchmarkAppendIntWidth4 (b * testing.B ) {
11381107 b .Run ("name=AppendInt" , func (b * testing.B ) {
11391108 var buf = make ([]byte , 0 , 8 )
0 commit comments