From 692af42858466e3e3789fe6d1b375b9ac9d4b8b2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 1 Mar 2024 11:39:21 +0000 Subject: [PATCH] operations: fix TestSetDirModTime for backends with SetDirModTime but not Metadata --- fs/operations/operations_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/operations/operations_test.go b/fs/operations/operations_test.go index 3119ce185..15143ee92 100644 --- a/fs/operations/operations_test.go +++ b/fs/operations/operations_test.go @@ -1748,6 +1748,9 @@ func TestSetDirModTime(t *testing.T) { require.NotNil(t, newDst) // Check the returned directory and one read from the listing - fstest.CheckDirModTime(ctx, t, r.Fremote, newDst, t2) + // The modtime will only be correct on newDst if it had a SetModTime method + if _, ok := newDst.(fs.SetModTimer); ok { + fstest.CheckDirModTime(ctx, t, r.Fremote, newDst, t2) + } fstest.CheckDirModTime(ctx, t, r.Fremote, fstest.NewDirectory(ctx, t, r.Fremote, name), t2) }