From b8247ce972da27d2c97846c67a86812eef964fc3 Mon Sep 17 00:00:00 2001 From: Tom Mombourquette Date: Wed, 20 Nov 2019 19:17:36 -0400 Subject: [PATCH] added test --- pkging/mem/file_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkging/mem/file_test.go b/pkging/mem/file_test.go index 93c4e78..aee7b9a 100644 --- a/pkging/mem/file_test.go +++ b/pkging/mem/file_test.go @@ -1,6 +1,7 @@ package mem import ( + "io" "io/ioutil" "testing" @@ -27,6 +28,16 @@ func Test_File_Seek(t *testing.T) { f, err = pkg.Open(":/wilco.band") r.NoError(err) + // seek to end of file before read + pos, err := f.Seek(0, io.SeekEnd) + r.NoError(err) + r.Equal(int64(len(data)), pos) + + // reset seek + pos, err = f.Seek(0, 0) + r.NoError(err) + r.Equal(int64(0), pos) + b, err := ioutil.ReadAll(f) r.NoError(err) r.Equal(data, b)