aboutsummaryrefslogtreecommitdiff
path: root/persistence/sessions_test.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-10 02:32:57 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-10 02:32:57 +0300
commit4eae44b9a27da488b8f6b4c5c057ff472051b087 (patch)
tree6bc21a6a9829313a419f475a93065f8dd4daa953 /persistence/sessions_test.go
parent43f9603b887a2395a9a14234bd078170b3bd0926 (diff)
parenta74e2bcb7d3262073d05aa89140b1d202b7f179d (diff)
Merge branch 'master' into adhoc
Diffstat (limited to 'persistence/sessions_test.go')
-rw-r--r--persistence/sessions_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/persistence/sessions_test.go b/persistence/sessions_test.go
index 0339378..001cfa0 100644
--- a/persistence/sessions_test.go
+++ b/persistence/sessions_test.go
@@ -88,3 +88,31 @@ func TestSessionSetAbsent(t *testing.T) {
t.Error("There shouldn't come a donkey!")
}
}
+
+func TestSessionIgnore(t *testing.T) {
+ session := Session{}
+ if session.IsChatIgnored(3) {
+ t.Error("Shouldn't be ignored yet")
+ }
+ if !session.IgnoreChat(3) {
+ t.Error("Shouldn't have been ignored")
+ }
+ if session.IgnoreChat(3) {
+ t.Error("Shouldn't ignore second time")
+ }
+ if !session.IsChatIgnored(3) {
+ t.Error("Should be ignored already")
+ }
+ if session.IsChatIgnored(-145) {
+ t.Error("Wrong chat is ignored")
+ }
+ if !session.UnignoreChat(3) {
+ t.Error("Should successfully unignore")
+ }
+ if session.UnignoreChat(3) {
+ t.Error("Should unignore second time")
+ }
+ if session.IsChatIgnored(3) {
+ t.Error("Shouldn't be ignored already")
+ }
+}