1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

changed cyclic dep detection

since interpolation can be used, detection should be a execution time,
and not before

now, to prevent infinite execution, there's a miximum of 100 calls per
task

closes #37
This commit is contained in:
Andrey Nering
2017-07-08 13:33:55 -03:00
parent fb4b0a187e
commit 2dd3564da1
6 changed files with 44 additions and 96 deletions

View File

@@ -199,3 +199,15 @@ func TestParams(t *testing.T) {
assert.Equal(t, f.content, string(content))
}
}
func TestCyclicDep(t *testing.T) {
const dir = "testdata/cyclic"
e := task.Executor{
Dir: dir,
Stdout: ioutil.Discard,
Stderr: ioutil.Discard,
}
assert.NoError(t, e.ReadTaskfile())
assert.IsType(t, &task.MaximumTaskCallExceededError{}, e.Run("task-1"))
}