forked from TrueCloudLab/rclone
vendor: update all dependencies to latest versions
This commit is contained in:
parent
911d121bb9
commit
b017fcfe9a
3048 changed files with 537057 additions and 189681 deletions
18
vendor/github.com/pkg/sftp/request-server_test.go
generated
vendored
18
vendor/github.com/pkg/sftp/request-server_test.go
generated
vendored
|
@ -315,6 +315,7 @@ func TestRequestReadlink(t *testing.T) {
|
|||
|
||||
func TestRequestReaddir(t *testing.T) {
|
||||
p := clientRequestServerPair(t)
|
||||
MaxFilelist = 22 // make not divisible by our test amount (100)
|
||||
defer p.Close()
|
||||
for i := 0; i < 100; i++ {
|
||||
fname := fmt.Sprintf("/foo_%02d", i)
|
||||
|
@ -327,3 +328,20 @@ func TestRequestReaddir(t *testing.T) {
|
|||
names := []string{di[18].Name(), di[81].Name()}
|
||||
assert.Equal(t, []string{"foo_18", "foo_81"}, names)
|
||||
}
|
||||
|
||||
func TestCleanPath(t *testing.T) {
|
||||
assert.Equal(t, "/", cleanPath("/"))
|
||||
assert.Equal(t, "/", cleanPath("//"))
|
||||
assert.Equal(t, "/a", cleanPath("/a/"))
|
||||
assert.Equal(t, "/a", cleanPath("a/"))
|
||||
assert.Equal(t, "/a/b/c", cleanPath("/a//b//c/"))
|
||||
|
||||
// filepath.ToSlash does not touch \ as char on unix systems, so os.PathSeparator is used for windows compatible tests
|
||||
bslash := string(os.PathSeparator)
|
||||
assert.Equal(t, "/", cleanPath(bslash))
|
||||
assert.Equal(t, "/", cleanPath(bslash+bslash))
|
||||
assert.Equal(t, "/a", cleanPath(bslash+"a"+bslash))
|
||||
assert.Equal(t, "/a", cleanPath("a"+bslash))
|
||||
assert.Equal(t, "/a/b/c", cleanPath(bslash+"a"+bslash+bslash+"b"+bslash+bslash+"c"+bslash))
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue