MCPcopy Index your code
hub / github.com/rclone/rclone / TestRWFileHandleSizeCreateNew

Function TestRWFileHandleSizeCreateNew

vfs/read_write_test.go:530–552  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

528}
529
530func TestRWFileHandleSizeCreateNew(t *testing.T) {
531 _, vfs, fh := rwHandleCreateFlags(t, false, "file1", os.O_WRONLY|os.O_CREATE)
532
533 // check initial size after opening
534 assertSize(t, vfs, fh, "file1", 0)
535
536 // write some bytes
537 n, err := fh.Write([]byte("hello"))
538 assert.NoError(t, err)
539 assert.Equal(t, 5, n)
540
541 // check size after writing
542 assertSize(t, vfs, fh, "file1", 5)
543
544 // check size after writing
545 assertSize(t, vfs, fh, "file1", 5)
546
547 // close
548 assert.NoError(t, fh.Close())
549
550 // check size after close
551 assertSize(t, vfs, nil, "file1", 5)
552}
553
554func testRWFileHandleOpenTest(t *testing.T, vfs *VFS, test *openTest) {
555 fileName := "open-test-file"

Callers

nothing calls this directly

Calls 5

rwHandleCreateFlagsFunction · 0.85
assertSizeFunction · 0.85
WriteMethod · 0.65
CloseMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…