Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMapInit (0.12 sec)

  1. src/expvar/expvar_test.go

    	}
    }
    
    func BenchmarkStringSet(b *testing.B) {
    	var s String
    
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			s.Set("red")
    		}
    	})
    }
    
    func TestMapInit(t *testing.T) {
    	RemoveAll()
    	colors := NewMap("bike-shed-colors")
    	colors.Add("red", 1)
    	colors.Add("blue", 1)
    	colors.Add("chartreuse", 1)
    
    	n := 0
    	colors.Do(func(KeyValue) { n++ })
    	if n != 3 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:46:19 UTC 2024
    - 13.4K bytes
    - Viewed (0)
Back to top