check the size of the file through the open file (if not nil) and via stat
(t *testing.T, vfs *VFS, fh *RWFileHandle, filepath string, size int64)
| 469 | |
| 470 | // check the size of the file through the open file (if not nil) and via stat |
| 471 | func assertSize(t *testing.T, vfs *VFS, fh *RWFileHandle, filepath string, size int64) { |
| 472 | if fh != nil { |
| 473 | assert.Equal(t, size, fh.Size()) |
| 474 | } |
| 475 | fi, err := vfs.Stat(filepath) |
| 476 | require.NoError(t, err) |
| 477 | assert.Equal(t, size, fi.Size()) |
| 478 | } |
| 479 | |
| 480 | func TestRWFileHandleSizeTruncateExisting(t *testing.T) { |
| 481 | _, vfs, fh := rwHandleCreateFlags(t, true, "dir/file1", os.O_WRONLY|os.O_TRUNC) |
no test coverage detected
searching dependent graphs…