march: return errors when listing dirs

Partially fixes #3172
This commit is contained in:
Aleksandar Jankovic 2019-06-20 13:50:25 +02:00 committed by Nick Craig-Wood
parent 1be1fc073e
commit cc0800a72e
5 changed files with 60 additions and 12 deletions

View file

@ -64,6 +64,20 @@ func TestCopy(t *testing.T) {
fstest.CheckItems(t, r.Fremote, file1)
}
func TestCopyMissingDirectory(t *testing.T) {
r := fstest.NewRun(t)
defer r.Finalise()
r.Mkdir(context.Background(), r.Fremote)
nonExistingFs, err := fs.NewFs("/non-existing")
if err != nil {
t.Fatal(err)
}
err = CopyDir(context.Background(), r.Fremote, nonExistingFs, false)
require.Error(t, err)
}
// Now with --no-traverse
func TestCopyNoTraverse(t *testing.T) {
r := fstest.NewRun(t)