mirror of
https://github.com/rclone/rclone.git
synced 2026-01-04 09:33:36 +00:00
sync: fix tests for overlapping with filter
In commit
3ccf222acb sync: overlap check is now filter-sensitive
The tests were attempting to write invalid objects on some backends
due to a leading / on the object name.
This fix also adds a few more test cases and makes sure the tests can
be run individually.
This commit is contained in:
@@ -1284,6 +1284,7 @@ func TestOverlappingFilterCheckWithoutFilter(t *testing.T) {
|
||||
expected bool
|
||||
}{
|
||||
{"name", "root", true},
|
||||
{"name", "/root", true},
|
||||
{"namey", "root", false},
|
||||
{"name", "rooty", false},
|
||||
{"namey", "rooty", false},
|
||||
@@ -1320,10 +1321,12 @@ func TestOverlappingFilterCheckWithFilter(t *testing.T) {
|
||||
expected bool
|
||||
}{
|
||||
{"name", "root", true},
|
||||
{"name", "/root", true},
|
||||
{"name", "root/", true},
|
||||
{"name", "root" + slash, true},
|
||||
{"name", "root/exclude", false},
|
||||
{"name", "root/exclude/", false},
|
||||
{"name", "/root/exclude/", false},
|
||||
{"name", "root" + slash + "exclude", false},
|
||||
{"name", "root" + slash + "exclude" + slash, false},
|
||||
{"name", "root/.ignore", false},
|
||||
|
||||
Reference in New Issue
Block a user