Debian Codegraph @

atomic_resolver_test.go

raw symbols SCIP
1 package snowflake_test
2
3 import (
4 "testing"
5
6 "github.com/kankanreno/go-snowflake"
7 )
8
9 func TestAtomicResolver(t *testing.T) {
10 id, _ := snowflake.AtomicResolver(1)
11
12 if id != 0 {
13 t.Error("Sequence should be equal 0")
14 }
15 }
16
17 func BenchmarkCombinationParallel(b *testing.B) {
18 b.RunParallel(func(pb *testing.PB) {
19 for pb.Next() {
20 _, _ = snowflake.AtomicResolver(1)
21 }
22 })
23 }
24
25 func BenchmarkAtomicResolver(b *testing.B) {
26 for i := 0; i < b.N; i++ {
27 _, _ = snowflake.AtomicResolver(1)
28 }
29 }