add debug command. (#87)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2019-01-18 16:06:22 +08:00
committed by GitHub
parent d921289474
commit 699675c8fa
4 changed files with 14 additions and 5 deletions
+4 -4
View File
@@ -263,7 +263,7 @@ func TestIgnoreList(t *testing.T) {
KeyPath: "tests/.ssh/id_rsa",
Source: []string{"tests/global/*", "!tests/global/c.txt"},
StripComponents: 2,
Target: []string{filepath.Join(u.HomeDir, "123")},
Target: []string{filepath.Join(u.HomeDir, "ignore")},
CommandTimeout: 60,
TarExec: "tar",
},
@@ -273,11 +273,11 @@ func TestIgnoreList(t *testing.T) {
assert.Nil(t, err)
// check file exist
if _, err := os.Stat(filepath.Join(u.HomeDir, "123/c.txt")); os.IsExist(err) {
t.Fatalf("SCP-error: %v", err)
if _, err := os.Stat(filepath.Join(u.HomeDir, "ignore/c.txt")); err == nil {
t.Fatal("c.txt file exist")
}
if _, err := os.Stat(filepath.Join(u.HomeDir, "123/d.txt")); os.IsNotExist(err) {
if _, err := os.Stat(filepath.Join(u.HomeDir, "ignore/d.txt")); os.IsNotExist(err) {
t.Fatalf("SCP-error: %v", err)
}
}