Tests for UnSet

This commit is contained in:
Ola
2023-03-14 17:33:14 +01:00
parent 31c7177008
commit af3ecc1cef
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -14,5 +14,5 @@ jobs:
with:
go-version: '1.19'
- 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
+17
View File
@@ -661,6 +661,7 @@ func TestSessionKeysConcurrent(t *testing.T) {
go func() {
s.Set("test", TestMsg)
v1, exists := s.Get("test")
assert.True(t, exists)
@@ -675,6 +676,22 @@ func TestSessionKeysConcurrent(t *testing.T) {
}
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) {