1package imapserver
2
3import (
4 "testing"
5)
6
7func TestUnsubscribe(t *testing.T) {
8 tc := start(t)
9 defer tc.close()
10
11 tc.client.Login("mjl@mox.example", password0)
12
13 tc.transactf("bad", "unsubscribe") // Missing param.
14 tc.transactf("bad", "unsubscribe ") // Missing param.
15 tc.transactf("bad", "unsubscribe fine ") // Leftover data.
16
17 tc.transactf("no", "unsubscribe a/b") // Does not exist and is not subscribed.
18 tc.transactf("ok", "create a/b")
19 tc.transactf("ok", "unsubscribe a/b")
20 tc.transactf("ok", "unsubscribe a/b") // Can unsubscribe even if it does not exist.
21 tc.transactf("ok", "subscribe a/b")
22 tc.transactf("ok", "unsubscribe a/b")
23}
24