File: ok_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 (36 lines) | stat: -rw-r--r-- 950 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
32
33
34
35
36
package response

import (
	"testing"

	"github.com/ProtonMail/gluon/imap"
	"github.com/stretchr/testify/assert"
)

func TestOkUntagged(t *testing.T) {
	assert.Equal(t, `* OK`, Ok().String())
}

func TestOkTagged(t *testing.T) {
	assert.Equal(t, `tag OK`, Ok("tag").String())
}

func TestOkUnseen(t *testing.T) {
	assert.Equal(t, `* OK [UNSEEN 17]`, Ok().WithItems(ItemUnseen(17)).String())
}

func TestOkPermanentFlags(t *testing.T) {
	assert.Equal(t, `* OK [PERMANENTFLAGS (\Deleted)]`, Ok().WithItems(ItemPermanentFlags(imap.NewFlagSet(`\Deleted`))).String())
}

func TestOkUIDNext(t *testing.T) {
	assert.Equal(t, `* OK [UIDNEXT 4392]`, Ok().WithItems(ItemUIDNext(4392)).String())
}

func TestOkUIDValidity(t *testing.T) {
	assert.Equal(t, `* OK [UIDVALIDITY 3857529045]`, Ok().WithItems(ItemUIDValidity(3857529045)).String())
}

func TestOkReadOnly(t *testing.T) {
	assert.Equal(t, `* OK [READ-ONLY]`, Ok().WithItems(ItemReadOnly()).String())
}