Tests for UnSet
This commit is contained in:
@@ -14,5 +14,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: '1.19'
|
go-version: '1.19'
|
||||||
- run: go get -t -v ./...
|
- run: go get -t -v ./...
|
||||||
- run: go test -race -coverprofile=coverage.out -covermode=atomic
|
- run: go test -race -coverprofile=coverage.out -covermode=atomic -timeout 5s
|
||||||
- uses: codecov/codecov-action@v3
|
- uses: codecov/codecov-action@v3
|
||||||
|
|||||||
@@ -661,6 +661,7 @@ func TestSessionKeysConcurrent(t *testing.T) {
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
s.Set("test", TestMsg)
|
s.Set("test", TestMsg)
|
||||||
|
|
||||||
v1, exists := s.Get("test")
|
v1, exists := s.Get("test")
|
||||||
|
|
||||||
assert.True(t, exists)
|
assert.True(t, exists)
|
||||||
@@ -675,6 +676,22 @@ func TestSessionKeysConcurrent(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
|
for i := 0; i < 100; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
s.UnSet("test")
|
||||||
|
|
||||||
|
_, exists := s.Get("test")
|
||||||
|
|
||||||
|
assert.False(t, exists)
|
||||||
|
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMisc(t *testing.T) {
|
func TestMisc(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user