8 "github.com/mjl-/mox/imapclient"
11func TestIdle(t *testing.T) {
14 tc1.client.Login("mjl@mox.example", password0)
16 tc2 := startNoSwitchboard(t)
18 tc2.client.Login("mjl@mox.example", password0)
20 tc1.transactf("ok", "select inbox")
21 tc2.transactf("ok", "select inbox")
23 // todo: test with delivery through smtp
26 tc2.readprefixline("+ ")
27 done := make(chan error)
32 done <- fmt.Errorf("%v", x)
35 untagged, _ := tc2.client.ReadUntagged()
36 var exists imapclient.UntaggedExists
37 tuntagged(tc2.t, untagged, &exists)
38 // todo: validate the data we got back.
39 tc2.writelinef("done")
43 tc1.transactf("ok", "append inbox () {%d+}\r\n%s", len(exampleMsg), exampleMsg)
44 timer := time.NewTimer(time.Second)
48 tc1.check(err, "idle")
50 t.Fatalf("idle did not finish")