summaryrefslogtreecommitdiff
path: root/fs_test.go
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2022-08-15 06:51:43 +0300
committerMarin Ivanov <[email protected]>2022-08-15 06:51:43 +0300
commit36b2b55df13d36f7e34e88a1b10df30fe573a0b7 (patch)
tree4b96dbabc973cbc0e688d32167243e10752acfc7 /fs_test.go
parentf8fc14b2e0a10c64de0bd87f831ebde4f705b79b (diff)
Add method to close writer with error
Diffstat (limited to 'fs_test.go')
-rw-r--r--fs_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs_test.go b/fs_test.go
index 7e9765c..7752858 100644
--- a/fs_test.go
+++ b/fs_test.go
@@ -90,10 +90,9 @@ func TestFsWriteError(t *testing.T) {
f, err := afs.Fs.Create("dir/file")
is.NoErr(err)
- w := f.(*File).w.(*io.PipeWriter)
- _, err = w.Write(testdata)
+ _, err = f.Write(testdata)
is.NoErr(err)
- err = w.CloseWithError(errors.New("disk died"))
+ err = f.(*File).CloseWriterWithError(errors.New("disk died"))
is.NoErr(err)
_, err = afs.Stat("dir/file")
is.Equal(err, os.ErrNotExist)