Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package syncUtil
import (
"fmt"
"testing"
)
var (
lockerUtilObj = NewLockerUtil()
)
func LockerUtil_TestGetLock(t *testing.T) {
count := 100
for i := 1; i <= count; i++ {
lockerUtilObj.GetLock(fmt.Sprintf("%d", i))
if lockerCount := len(lockerUtilObj.lockerMap); lockerCount != i {
t.Errorf("(GetLock)Expected %d locker, but now got: %d", count, lockerCount)
}
}
for i := count; i > 0; i-- {
lockerUtilObj.ReleaseLock(fmt.Sprintf("%d", i))
if lockerCount := len(lockerUtilObj.lockerMap); lockerCount != i-1 {
t.Errorf("(ReleaseLock)Expected %d locker, but now got: %d", count, lockerCount)
}
}
}