MCPcopy
hub / github.com/rclone/rclone / TestCacheSetModTime

Function TestCacheSetModTime

vfs/vfscache/cache_test.go:658–674  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

656}
657
658func TestCacheSetModTime(t *testing.T) {
659 _, c := newTestCache(t)
660
661 t1 := time.Date(2010, 1, 2, 3, 4, 5, 9, time.UTC)
662
663 potato := c.Item("potato")
664 require.NoError(t, potato.Open(nil))
665 require.NoError(t, potato.Truncate(5))
666 require.NoError(t, potato.Close(nil))
667
668 c.SetModTime("potato", t1)
669 osPath := potato.c.toOSPath("potato")
670 fi, err := os.Stat(osPath)
671 require.NoError(t, err)
672
673 fstest.AssertTimeEqualWithPrecision(t, "potato", t1, fi.ModTime(), time.Second)
674}
675
676func TestCacheTotaInUse(t *testing.T) {
677 _, c := newTestCache(t)

Callers

nothing calls this directly

Calls 10

newTestCacheFunction · 0.85
ItemMethod · 0.80
toOSPathMethod · 0.80
OpenMethod · 0.65
TruncateMethod · 0.65
CloseMethod · 0.65
SetModTimeMethod · 0.65
StatMethod · 0.65
ModTimeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…