1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

refactor: unify how executor tests are written (#2042)

* feat: use TaskTest for executor tests

* feat: more tests

* feat: separate tests for executing and formatting with new functional options that work for both test types

* feat: formatter tests

* refactor: more tests
This commit is contained in:
Pete Davison
2025-03-31 17:53:58 +01:00
committed by GitHub
parent 180fcef364
commit 4736bc2734
175 changed files with 1706 additions and 1111 deletions

View File

@ -217,6 +217,14 @@ func ExecutorWithAssumeYes(assumeYes bool) ExecutorOption {
}
// WithAssumeTerm is used for testing purposes to simulate a terminal.
func ExecutorWithAssumeTerm(assumeTerm bool) ExecutorOption {
return func(e *Executor) {
e.AssumeTerm = assumeTerm
}
}
// ExecutorWithDry tells the [Executor] to output the commands that would be run
// without actually running them.
func ExecutorWithDry(dry bool) ExecutorOption {
return func(e *Executor) {
e.Dry = dry