diff options
Diffstat (limited to 'src/sync/map_test.go')
| -rw-r--r-- | src/sync/map_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sync/map_test.go b/src/sync/map_test.go index cb820e7be2..f12c43a28f 100644 --- a/src/sync/map_test.go +++ b/src/sync/map_test.go @@ -358,13 +358,13 @@ func TestConcurrentClear(t *testing.T) { }) } -func TestMapClearNoAllocations(t *testing.T) { +func TestMapClearOneAllocation(t *testing.T) { testenv.SkipIfOptimizationOff(t) var m sync.Map allocs := testing.AllocsPerRun(10, func() { m.Clear() }) - if allocs > 0 { - t.Errorf("AllocsPerRun of m.Clear = %v; want 0", allocs) + if allocs > 1 { + t.Errorf("AllocsPerRun of m.Clear = %v; want 1", allocs) } } |
