mox/main_test.go
Mechiel Lukkien cb229cb6cf
mox!
2023-01-30 14:27:06 +01:00

24 lines
447 B
Go

package main
import (
"strings"
"testing"
"github.com/mjl-/mox/mlog"
)
func TestParseDovecotKeywords(t *testing.T) {
const data = `0 Old
1 Junk
2 NonJunk
3 $Forwarded
4 $Junk
`
keywords := tryParseDovecotKeywords(strings.NewReader(data), mlog.New("dovecotkeywords"))
got := strings.Join(keywords, ",")
want := "Old,Junk,NonJunk,$Forwarded,$Junk"
if got != want {
t.Fatalf("parsing dovecot keywords, got %q, want %q", got, want)
}
}