@cryptotaxi247 / kubo / commits / acf12b6ea

mfs: seek to 0 before reading in `TestTruncateAndWrite`

License: MIT Signed-off-by: Lucas Molas <schomatis@gmail.com>

Lucas Molas committed Jul 19, 2018 at 00:18 UTC acf12b6eaf61e2456c509b8e5ce1aca606243aa8
1 file changed +7 -1
mfs/mfs_test.go
+7 -1
@@ -1167,12 +1167,18 @@ func TestTruncateAndWrite(t *testing.T) {
1167 if l != len("test") {
1168 t.Fatal("incorrect write length")
1169 }
1170 +
1171 + _, err = fd.Seek(0, io.SeekStart)
1172 + if err != nil {
1173 + t.Fatal(err)
1174 + }
1175 +
1176 data, err := ioutil.ReadAll(fd)
1177 if err != nil {
1178 t.Fatal(err)
1179 }
1180 if string(data) != "test" {
1175 - t.Errorf("read error at read %d, read: %v", i, data)
1181 + t.Fatalf("read error at read %d, read: %v", i, data)
1182 }
1183 }
1184 }