forked from mirror/pkger
added test
This commit is contained in:
parent
d9ef17a04d
commit
b8247ce972
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue