Forked the emersion/go-imap v1 project.
This commit is contained in:
28
imapclient/append_test.go
Normal file
28
imapclient/append_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package imapclient_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/emersion/go-imap/v2"
|
||||
)
|
||||
|
||||
func TestAppend(t *testing.T) {
|
||||
client, server := newClientServerPair(t, imap.ConnStateSelected)
|
||||
defer client.Close()
|
||||
defer server.Close()
|
||||
|
||||
body := "This is a test message."
|
||||
|
||||
appendCmd := client.Append("INBOX", int64(len(body)), nil)
|
||||
if _, err := appendCmd.Write([]byte(body)); err != nil {
|
||||
t.Fatalf("AppendCommand.Write() = %v", err)
|
||||
}
|
||||
if err := appendCmd.Close(); err != nil {
|
||||
t.Fatalf("AppendCommand.Close() = %v", err)
|
||||
}
|
||||
if _, err := appendCmd.Wait(); err != nil {
|
||||
t.Fatalf("AppendCommand.Wait() = %v", err)
|
||||
}
|
||||
|
||||
// TODO: fetch back message and check body
|
||||
}
|
||||
Reference in New Issue
Block a user