3 // Copyright 2023 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
15 for i := 0; i < 100; i++ {
23 m := map[float64]int{}
24 // Fill to just before a growth trigger.
25 const N = 13 << 4 // 6.5 * 2 * 2^k
26 for i := 0; i < N; i++ {
32 // Iterate through map.
36 // Partway through iteration, clear the map.
39 // If we advance to the next iteration, that's a bug.
45 panic("clear did not empty the map")
51 m := map[float64]int{}
52 // Fill to just before a growth trigger.
53 const N = 13 << 4 // 6.5 * 2 * 2^k
54 for i := 0; i < N; i++ {
60 // Iterate through map.
62 v := reflect.ValueOf(m)
66 // Partway through iteration, clear the map.
69 // If we advance to the next iteration, that's a bug.
75 panic("clear did not empty the map")