mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
lib/bucket: add IsAllSlashes function
This commit is contained in:
@@ -45,6 +45,24 @@ func TestJoin(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsAllSlashes(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
in string
|
||||
want bool
|
||||
}{
|
||||
{in: "", want: false},
|
||||
{in: "/", want: true},
|
||||
{in: "x/", want: false},
|
||||
{in: "/x", want: false},
|
||||
{in: "//", want: true},
|
||||
{in: "/x/", want: false},
|
||||
{in: "///", want: true},
|
||||
} {
|
||||
got := IsAllSlashes(test.in)
|
||||
assert.Equal(t, test.want, got, test.in)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
c := NewCache()
|
||||
errBoom := errors.New("boom")
|
||||
|
||||
Reference in New Issue
Block a user