operations: skip the Unicode move test where NFD names aren't kept

Before this change, `TestMoveUnicodeEquivalentWithoutServerSideMove`
failed on backends that can't store a file under the NFD name it was given:
`mailru` rejects the name ("invalid characters in object name"), and
`cloudinary`, `filelu` and `seafile` don't find the file again under it.
Tests in `fs/operations` run against every backend, so this one needs to
skip where the precondition doesn't hold.

After this change, the test skips when the NFD name can't be uploaded or
the file isn't found again under it.
This commit is contained in:
nielash authored and Nick Craig-Wood committed 2026-10-26 17:41:06 +00:00
1 parent 9f1d0cf021
commit ea465cbb97
1 file changed
+8 -1
+8 -1
View File
@@ -1172,8 +1172,15 @@ func TestMoveUnicodeEquivalentWithoutServerSideMove(t *testing.T) {
nfd := norm.NFD.String("sub/équivalent.txt")
nfc := norm.NFC.String("sub/équivalent.txt")
file1 := r.WriteObject(ctx, nfd, "file1 contents", t1)
file1 := fstest.NewItem(nfd, "file1 contents", t1)
_, err := r.Fremote.Put(ctx, bytes.NewBufferString("file1 contents"), object.NewStaticObjectInfo(nfd, t1, file1.Size, true, nil, nil))
if err != nil {
t.Skipf("remote can't store an NFD name: %v", err)
}
src, err := r.Fremote.NewObject(ctx, nfd)
if errors.Is(err, fs.ErrorObjectNotFound) {
t.Skip("remote doesn't keep an NFD name as written")
}
require.NoError(t, err)
_, err = operations.Move(ctx, r.Fremote, nil, nfc, src)