1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-17 16:03:15 +00:00

fstest: Make Copy mutation test work properly

Before this change it could miss a mutation if the Modtime was cached
This commit is contained in:
Nick Craig-Wood
2026-01-09 12:33:31 +00:00
parent 189e6dbf6a
commit 07805796ab

View File

@@ -1276,6 +1276,8 @@ func Run(t *testing.T, opt *Opt) {
err = dst.SetModTime(ctx, fstest.Time("2004-03-03T04:05:06.499999999Z"))
if err != fs.ErrorCantSetModTimeWithoutDelete && err != fs.ErrorCantSetModTime {
assert.NoError(t, err)
// Re-read the source and check its modtime
src = fstest.NewObject(ctx, t, f, src.Remote())
assert.False(t, src.ModTime(ctx).Equal(dst.ModTime(ctx)), "mutating dst should not mutate src -- is it Copying by pointer?")
}