1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 16:42:41 +08:00
This commit is contained in:
2023-08-25 15:31:00 +08:00
parent 04aecd4abc
commit b0a97978d8
58 changed files with 1330 additions and 476 deletions

View 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())
}
}