Sha256: 28155b4b23b8b0f4043d6f7219329b1b226c4611fcfdfd59ae5600fcc2efe64c
Contents?: true
Size: 576 Bytes
Versions: 396
Compression:
Stored size: 576 Bytes
Contents
// +build bonus package robotname import "testing" func TestCollisions(t *testing.T) { m := map[string]bool{} // Test uniqueness for new robots. // 10k should be plenty to catch names generated // randomly without a uniqueness check. for i := 0; i < 10000; i++ { n := New().Name() if m[n] { t.Fatalf("Name %s reissued after %d robots.", n, i) } m[n] = true } // Test that names aren't recycled either. r := New() for i := 0; i < 10000; i++ { r.Reset() n := r.Name() if m[n] { t.Fatalf("Name %s reissued after Reset.", n) } m[n] = true } }
Version data entries
396 entries across 396 versions & 1 rubygems