MCPcopy Create free account
hub / github.com/rclone/rclone / TestFileSetModTime

Function TestFileSetModTime

vfs/file_test.go:151–164  ·  view source on GitHub ↗

Test various combinations of setting mod times with and without the cache and with and without opening or writing to the file. Each of these tests a different path through the VFS code.

(t *testing.T)

Source from the content-addressed store, hash-verified

149//
150// Each of these tests a different path through the VFS code.
151func TestFileSetModTime(t *testing.T) {
152 for _, cacheMode := range []vfscommon.CacheMode{vfscommon.CacheModeOff, vfscommon.CacheModeFull} {
153 for _, open := range []bool{false, true} {
154 for _, write := range []bool{false, true} {
155 if write && !open {
156 continue
157 }
158 t.Run(fmt.Sprintf("cache=%v,open=%v,write=%v", cacheMode, open, write), func(t *testing.T) {
159 testFileSetModTime(t, cacheMode, open, write)
160 })
161 }
162 }
163 }
164}
165
166func fileCheckContents(t *testing.T, file *File) {
167 fd, err := file.Open(os.O_RDONLY)

Callers

nothing calls this directly

Calls 2

testFileSetModTimeFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…