MCPcopy
hub / github.com/rclone/rclone / TestDirHandleMethods

Function TestDirHandleMethods

vfs/dir_handle_test.go:13–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestDirHandleMethods(t *testing.T) {
14 _, _, dir, _ := dirCreate(t)
15
16 h, err := dir.Open(os.O_RDONLY)
17 require.NoError(t, err)
18 fh, ok := h.(*DirHandle)
19 assert.True(t, ok)
20
21 // String
22 assert.Equal(t, "dir/ (r)", fh.String())
23 assert.Equal(t, "<nil *DirHandle>", (*DirHandle)(nil).String())
24 assert.Equal(t, "<nil *DirHandle.d>", newDirHandle(nil).String())
25
26 // Stat
27 fi, err := fh.Stat()
28 require.NoError(t, err)
29 assert.Equal(t, dir, fi)
30
31 // Node
32 assert.Equal(t, dir, fh.Node())
33
34 // Close
35 require.NoError(t, h.Close())
36 assert.Equal(t, []os.FileInfo(nil), fh.fis)
37}
38
39func TestDirHandleReaddir(t *testing.T) {
40 r, vfs := newTestVFS(t)

Callers

nothing calls this directly

Calls 8

dirCreateFunction · 0.85
newDirHandleFunction · 0.85
OpenMethod · 0.65
StringMethod · 0.65
StatMethod · 0.65
NodeMethod · 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…