mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
fstests: allow skipping of the broken UTF-8 test for the cache backend
This commit is contained in:
parent
e8b92f4853
commit
6abaa9e22c
1
backend/cache/cache_test.go
vendored
1
backend/cache/cache_test.go
vendored
@ -19,5 +19,6 @@ func TestIntegration(t *testing.T) {
|
|||||||
NilObject: (*cache.Object)(nil),
|
NilObject: (*cache.Object)(nil),
|
||||||
UnimplementableFsMethods: []string{"PublicLink", "MergeDirs", "OpenWriterAt"},
|
UnimplementableFsMethods: []string{"PublicLink", "MergeDirs", "OpenWriterAt"},
|
||||||
UnimplementableObjectMethods: []string{"MimeType", "ID", "GetTier", "SetTier"},
|
UnimplementableObjectMethods: []string{"MimeType", "ID", "GetTier", "SetTier"},
|
||||||
|
SkipInvalidUTF8: true, // invalid UTF-8 confuses the cache
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -260,6 +260,7 @@ type Opt struct {
|
|||||||
UnimplementableObjectMethods []string // List of methods which can't be implemented in this wrapping Fs
|
UnimplementableObjectMethods []string // List of methods which can't be implemented in this wrapping Fs
|
||||||
SkipFsCheckWrap bool // if set skip FsCheckWrap
|
SkipFsCheckWrap bool // if set skip FsCheckWrap
|
||||||
SkipObjectCheckWrap bool // if set skip ObjectCheckWrap
|
SkipObjectCheckWrap bool // if set skip ObjectCheckWrap
|
||||||
|
SkipInvalidUTF8 bool // if set skip invalid UTF-8 checks
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if x is found in ss
|
// 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"},
|
{"invalid UTF-8", "invalid utf-8\xfe"},
|
||||||
} {
|
} {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
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
|
// turn raw strings into Standard encoding
|
||||||
fileName := encoder.Standard.Encode(test.path)
|
fileName := encoder.Standard.Encode(test.path)
|
||||||
dirName := fileName
|
dirName := fileName
|
||||||
|
Loading…
Reference in New Issue
Block a user