Commit acf12b6e authored by Lucas Molas's avatar Lucas Molas

mfs: seek to 0 before reading in `TestTruncateAndWrite`

License: MIT
Signed-off-by: default avatarLucas Molas <schomatis@gmail.com>
parent 6f140d25
......@@ -1167,12 +1167,18 @@ func TestTruncateAndWrite(t *testing.T) {
if l != len("test") {
t.Fatal("incorrect write length")
}
_, err = fd.Seek(0, io.SeekStart)
if err != nil {
t.Fatal(err)
}
data, err := ioutil.ReadAll(fd)
if err != nil {
t.Fatal(err)
}
if string(data) != "test" {
t.Errorf("read error at read %d, read: %v", i, data)
t.Fatalf("read error at read %d, read: %v", i, data)
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment