Add a test for RetrFrom method.

This commit is contained in:
Julien Laffaye 2015-08-20 22:47:09 +02:00
parent 4cb43e6615
commit 7534ffcb97

View File

@ -80,10 +80,18 @@ func testConn(t *testing.T, passive bool) {
r.Close() r.Close()
} }
r, err = c.Retr("tset") r, err = c.RetrFrom("tset", 5)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} else { } else {
buf, err := ioutil.ReadAll(r)
if err != nil {
t.Error(err)
}
expected := testData[5:]
if string(buf) != expected {
t.Errorf("read %q, expected %q", buf, expected)
}
r.Close() r.Close()
} }