mirror of
https://github.com/go-task/task.git
synced 2026-06-11 09:51:50 +00:00
Merge branch 'group-begin-message' of https://github.com/janslow/task into janslow-group-begin-message
This commit is contained in:
25
task_test.go
25
task_test.go
@@ -1193,3 +1193,28 @@ func TestIgnoreNilElements(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestOutputGroup(t *testing.T) {
|
||||
const dir = "testdata/output_group"
|
||||
var buff bytes.Buffer
|
||||
e := task.Executor{
|
||||
Dir: dir,
|
||||
Stdout: &buff,
|
||||
Stderr: &buff,
|
||||
}
|
||||
assert.NoError(t, e.Setup())
|
||||
|
||||
expectedOutputOrder := strings.TrimSpace(`
|
||||
task: [hello] echo 'Hello!'
|
||||
::group::hello
|
||||
Hello!
|
||||
::endgroup::
|
||||
task: [bye] echo 'Bye!'
|
||||
::group::bye
|
||||
Bye!
|
||||
::endgroup::
|
||||
`)
|
||||
assert.NoError(t, e.Run(context.Background(), taskfile.Call{Task: "bye"}))
|
||||
t.Log(buff.String())
|
||||
assert.Equal(t, strings.TrimSpace(buff.String()), expectedOutputOrder)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user