File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ func TestStringIntern(t *testing.T) {
2020 t .Fatalf ("wrong value: %q" , i .Field )
2121 }
2222 })
23- if allocsPerRun != 1 {
24- t .Fatalf ("expected 1 allocs, got %f" , allocsPerRun )
23+ if allocsPerRun > 1 {
24+ t .Fatalf ("expected <= 1 allocs, got %f" , allocsPerRun )
2525 }
2626
2727 var n NoIntern
@@ -35,7 +35,7 @@ func TestStringIntern(t *testing.T) {
3535 t .Fatalf ("wrong value: %q" , n .Field )
3636 }
3737 })
38- if allocsPerRun != 2 {
39- t .Fatalf ("expected 2 allocs, got %f" , allocsPerRun )
38+ if allocsPerRun > 2 {
39+ t .Fatalf ("expected <= 2 allocs, got %f" , allocsPerRun )
4040 }
4141}
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ func TestNocopy(t *testing.T) {
5353 t .Fatalf ("wrong value: %q" , res .B )
5454 }
5555 })
56- if allocsPerRun != 1 {
57- t .Fatalf ("noCopy field unmarshal: expected 1 allocs, got %f" , allocsPerRun )
56+ if allocsPerRun > 1 {
57+ t .Fatalf ("noCopy field unmarshal: expected <= 1 allocs, got %f" , allocsPerRun )
5858 }
5959
6060 data = []byte (`{"a": "valueNoCopy"}` )
@@ -67,7 +67,7 @@ func TestNocopy(t *testing.T) {
6767 t .Fatalf ("wrong value: %q" , res .A )
6868 }
6969 })
70- if allocsPerRun != 2 {
71- t .Fatalf ("copy field unmarshal: expected 2 allocs, got %f" , allocsPerRun )
70+ if allocsPerRun > 2 {
71+ t .Fatalf ("copy field unmarshal: expected <= 2 allocs, got %f" , allocsPerRun )
7272 }
7373}
You can’t perform that action at this time.
0 commit comments