Files
token-go/persist/count_watcher_test.go
2023-10-21 23:24:25 +08:00

25 lines
360 B
Go

package persist
import (
"testing"
)
func TestCountWatcher(t *testing.T) {
watcher := NewCountWatcher()
c := make(chan interface{})
go func() {
for i := 0; i < 20; i++ {
watcher.Login("", "", "", nil)
}
c <- struct{}{}
}()
for i := 0; i < 18; i++ {
watcher.Logout("", "", "")
}
<-c
t.Logf("GetCounts = %v", watcher.GetLoginCounts())
}