mirror of https://github.com/pkg/sftp.git
Add test for invalid input on Windows
This commit is contained in:
parent
bf40a02d09
commit
d0f04135b1
|
@ -335,6 +335,12 @@ func Test_toLocalPath(t *testing.T) {
|
||||||
args: args{workDir: cleanPath("C:\\Users\\User"), p: "/C:/file"},
|
args: args{workDir: cleanPath("C:\\Users\\User"), p: "/C:/file"},
|
||||||
want: "C:\\file",
|
want: "C:\\file",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "workdir and non-unixy path on Windows prefixes workdir",
|
||||||
|
goos: "windows",
|
||||||
|
args: args{workDir: cleanPath("C:\\Users\\User"), p: "C:\file"},
|
||||||
|
want: "C:\\Users\\User\\C:\file",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue