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