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-13 12:40:17 +00:00
parent 189e6dbf6a
commit 07805796ab
+2
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?")
}