1
0
mirror of https://github.com/go-task/task.git synced 2025-01-26 05:27:15 +02:00
task/task_test.go
2017-03-15 21:15:27 -03:00

46 lines
608 B
Go

package task_test
import (
"os"
"os/exec"
"path/filepath"
"testing"
)
func TestDeps(t *testing.T) {
const dir = "testdata/deps"
files := []string{
"d1.txt",
"d2.txt",
"d3.txt",
"d11.txt",
"d12.txt",
"d13.txt",
"d21.txt",
"d22.txt",
"d23.txt",
"d31.txt",
"d32.txt",
"d33.txt",
}
for _, f := range files {
_ = os.Remove(f)
}
c := exec.Command("task")
c.Dir = dir
if err := c.Run(); err != nil {
t.Error(err)
return
}
for _, f := range files {
f = filepath.Join(dir, f)
if _, err := os.Stat(f); err != nil {
t.Errorf("File %s should exists", f)
}
}
}