[#1628] fixed realtime panic on concurrent clients iteration

This commit is contained in:
Gani Georgiev committed 2023-01-18 15:42:04 +02:00
1 parent c1921aeef8
commit 7001a22d92
6 files changed
+101 -13

No files matched your search

+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")
}
}