From 7534ffcb974dfa71e121c0936ca020a147b89504 Mon Sep 17 00:00:00 2001 From: Julien Laffaye Date: Thu, 20 Aug 2015 22:47:09 +0200 Subject: [PATCH] Add a test for RetrFrom method. --- client_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index d217481..4827224 100644 --- a/client_test.go +++ b/client_test.go @@ -80,10 +80,18 @@ func testConn(t *testing.T, passive bool) { r.Close() } - r, err = c.Retr("tset") + r, err = c.RetrFrom("tset", 5) if err != nil { t.Error(err) } 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() }