server/id_test.go
Stephen McQuay c8efd34080 ignore new binary
Create new bserv binary

Herein lie the following ideas:

- change package visibility of many things
- try to stash the globals into structs
- the code is far from correct; it merely compiles
2014-03-31 23:21:14 -07:00

19 lines
297 B
Go

package botserv
import (
"testing"
)
func TestIDGenerator(t *testing.T) {
cache := make(map[string]bool)
var cur string
gg := NewIdGenerator()
for i := 0; i < 10000; i++ {
cur = gg.Hash()
if _, ok := cache[cur]; ok {
t.Errorf("unexpected duplicate key")
}
cache[cur] = true
}
}