Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

fstests: allow skipping of the broken UTF-8 test for the cache backend

Nick Craig-Wood6abaa9e22c61
diff --git a/backend/cache/cache_test.go b/backend/cache/cache_test.go
index 07d3d4745..5174c0bc4 100644
--- a/backend/cache/cache_test.go
+++ b/backend/cache/cache_test.go
@@ -19,5 +19,6 @@ func TestIntegration(t *testing.T) {
NilObject: (*cache.Object)(nil),
UnimplementableFsMethods: []string{"PublicLink", "MergeDirs", "OpenWriterAt"},
UnimplementableObjectMethods: []string{"MimeType", "ID", "GetTier", "SetTier"},
+ SkipInvalidUTF8: true, // invalid UTF-8 confuses the cache
})
}
diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go
index 2a3ce49f1..547f68895 100644
--- a/fstest/fstests/fstests.go
+++ b/fstest/fstests/fstests.go
@@ -260,6 +260,7 @@ type Opt struct {
UnimplementableObjectMethods []string // List of methods which can't be implemented in this wrapping Fs
SkipFsCheckWrap bool // if set skip FsCheckWrap
SkipObjectCheckWrap bool // if set skip ObjectCheckWrap
+ SkipInvalidUTF8 bool // if set skip invalid UTF-8 checks
}
// returns true if x is found in ss
@@ -564,6 +565,9 @@ func Run(t *testing.T, opt *Opt) {
{"invalid UTF-8", "invalid utf-8\xfe"},
} {
t.Run(test.name, func(t *testing.T) {
+ if opt.SkipInvalidUTF8 && test.name == "invalid UTF-8" {
+ t.Skip("Skipping " + test.name)
+ }
// turn raw strings into Standard encoding
fileName := encoder.Standard.Encode(test.path)
dirName := fileName