File: status_test.go

package info (click to toggle)
golang-github-protonmail-gluon 0.17.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,020 kB
  • sloc: sh: 55; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package tests

import (
	"testing"
)

func TestStatus(t *testing.T) {
	runOneToOneTestWithAuth(t, defaultServerOptions(t, withDelimiter(".")), func(c *testConnection, _ *testSession) {
		c.C("B001 CREATE blurdybloop")
		c.S("B001 OK CREATE")

		c.doAppend(`blurdybloop`, buildRFC5322TestLiteral(`To: 1@pm.me`), `\Seen`).expect("OK")
		c.doAppend(`blurdybloop`, buildRFC5322TestLiteral(`To: 2@pm.me`)).expect("OK")
		c.doAppend(`blurdybloop`, buildRFC5322TestLiteral(`To: 3@pm.me`)).expect("OK")

		c.C("A042 STATUS blurdybloop (MESSAGES UNSEEN)")
		c.S(`* STATUS "blurdybloop" (MESSAGES 3 UNSEEN 2)`)
		c.S("A042 OK STATUS")
	})
}

func TestStatusWithUtf8MailboxNames(t *testing.T) {
	runOneToOneTestWithAuth(t, defaultServerOptions(t, withDelimiter(".")), func(c *testConnection, s *testSession) {
		s.mailboxCreated("user", []string{"mbox-öüäëæøå"})
		s.flush("user")
		c.doAppend(`mbox-&APYA,ADkAOsA5gD4AOU-`, buildRFC5322TestLiteral(`To: 1@pm.me`)).expect("OK")
		c.C(`a STATUS mbox-&APYA,ADkAOsA5gD4AOU- (MESSAGES)`)
		c.S(`* STATUS "mbox-&APYA,ADkAOsA5gD4AOU-" (MESSAGES 1)`)
		c.OK(`a`)
	})
}