[#1628] fixed realtime panic on concurrent clients iteration

This commit is contained in:
Gani Georgiev
2023-01-18 15:41:33 +02:00
parent c1921aeef8
commit 7001a22d92
6 changed files with 101 additions and 13 deletions
+14
View File
@@ -129,3 +129,17 @@ func TestSetAndGet(t *testing.T) {
t.Errorf("Expected 1, got %v", result)
}
}
func TestDiscard(t *testing.T) {
c := subscriptions.NewDefaultClient()
if v := c.IsDiscarded(); v {
t.Fatal("Expected false, got true")
}
c.Discard()
if v := c.IsDiscarded(); !v {
t.Fatal("Expected true, got false")
}
}