Apply .gitignore rules
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user