We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 706a216 commit ae08e17Copy full SHA for ae08e17
imapclient/append_test.go
@@ -0,0 +1,28 @@
1
+package imapclient_test
2
+
3
+import (
4
+ "testing"
5
6
+ "github.com/emersion/go-imap/v2"
7
+)
8
9
+func TestAppend(t *testing.T) {
10
+ client, server := newClientServerPair(t, imap.ConnStateSelected)
11
+ defer client.Close()
12
+ defer server.Close()
13
14
+ body := "This is a test message."
15
16
+ appendCmd := client.Append("INBOX", int64(len(body)), nil)
17
+ if _, err := appendCmd.Write([]byte(body)); err != nil {
18
+ t.Fatalf("AppendCommand.Write() = %v", err)
19
+ }
20
+ if err := appendCmd.Close(); err != nil {
21
+ t.Fatalf("AppendCommand.Close() = %v", err)
22
23
+ if _, err := appendCmd.Wait(); err != nil {
24
+ t.Fatalf("AppendCommand.Wait() = %v", err)
25
26
27
+ // TODO: fetch back message and check body
28
+}
0 commit comments