1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

vfs: Fix TestWriteFileDoubleClose with --vfs-cache-mode >= writes

This was causing the file to be closed on Flush() instead of Release()
when the file was opened with O_TRUNC.
This commit is contained in:
Nick Craig-Wood
2018-02-26 21:26:32 +00:00
parent c3d0f68923
commit b91bd32489
2 changed files with 20 additions and 22 deletions

View File

@@ -350,7 +350,8 @@ func TestRWFileHandleWriteAt(t *testing.T) {
// Preconditions
assert.Equal(t, int64(0), offset())
assert.True(t, fh.opened)
assert.True(t, fh.writeCalled)
assert.False(t, fh.writeCalled)
assert.True(t, fh.changed)
// Write the data
n, err := fh.WriteAt([]byte("hello**"), 0)