From c0977d7a78276bf9b67bbb6e515f71ada0628246 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 9 Jan 2026 12:33:31 +0000 Subject: [PATCH] fstest: Make Copy mutation test work properly Before this change it could miss a mutation if the Modtime was cached --- fstest/fstests/fstests.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index b1651a55f..78f716dcb 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -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?") }