mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 16:42:41 +08:00
update
This commit is contained in:
32
idGenerator/id_generator_test.go
Normal file
32
idGenerator/id_generator_test.go
Normal file
@ -0,0 +1,32 @@
|
||||
package idgenerator_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
idgenerator "github.com/charlienet/go-mixed/idGenerator"
|
||||
)
|
||||
|
||||
func TestNextId(t *testing.T) {
|
||||
generator := idgenerator.New(idgenerator.Config{})
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Log(generator.Next().Id())
|
||||
}
|
||||
}
|
||||
|
||||
func TestBatch(t *testing.T) {
|
||||
generator := idgenerator.New(idgenerator.Config{})
|
||||
|
||||
b := generator.Batch(20)
|
||||
for _, i := range b {
|
||||
t.Log(i)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNext(t *testing.T) {
|
||||
generator := idgenerator.New(idgenerator.Config{})
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
t.Log(generator.Next())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user