From 1e06cf67586c4b78f3a59b385da320f05c03b47c Mon Sep 17 00:00:00 2001 From: Will McCutchen <will@mccutch.org> Date: Sat, 24 Jun 2017 13:33:25 -0700 Subject: [PATCH] Chase that test coverage --- httpbin/helpers_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/httpbin/helpers_test.go b/httpbin/helpers_test.go index 283d9b7..0636e0f 100644 --- a/httpbin/helpers_test.go +++ b/httpbin/helpers_test.go @@ -140,5 +140,17 @@ func TestSyntheticByteStream(t *testing.T) { assertNil(t, err) assertIntEqual(t, count, 5) assertBytesEqual(t, p, []byte{90, 91, 92, 93, 94}) + + // invalid whence + _, err = s.Seek(10, 666) + if err.Error() != "Seek: invalid whence" { + t.Errorf("Expected \"Seek: invalid whence\", got %#v", err.Error()) + } + + // invalid offset + _, err = s.Seek(-10, io.SeekStart) + if err.Error() != "Seek: invalid offset" { + t.Errorf("Expected \"Seek: invalid offset\", got %#v", err.Error()) + } }) } -- GitLab