(t *testing.T)
| 449 | } |
| 450 | |
| 451 | func TestRWFileHandleReleaseWrite(t *testing.T) { |
| 452 | _, _, fh := rwHandleCreateWriteOnly(t) |
| 453 | |
| 454 | // Write some data |
| 455 | n, err := fh.Write([]byte("hello")) |
| 456 | assert.NoError(t, err) |
| 457 | assert.Equal(t, 5, n) |
| 458 | |
| 459 | // Check Release closes file |
| 460 | err = fh.Release() |
| 461 | assert.NoError(t, err) |
| 462 | assert.True(t, fh.closed) |
| 463 | |
| 464 | // Check Release does nothing if called again |
| 465 | err = fh.Release() |
| 466 | assert.NoError(t, err) |
| 467 | assert.True(t, fh.closed) |
| 468 | } |
| 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) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…