mirror of
https://github.com/go-task/task.git
synced 2025-03-27 21:48:54 +02:00
refactoring
This commit is contained in:
parent
c82a7240bb
commit
5cfd9bbbbd
@ -24,7 +24,8 @@ func printTaskCommands(cmds []*taskfile.Cmd, logger *logger.Logger) {
|
|||||||
logger.Outf("")
|
logger.Outf("")
|
||||||
logger.Outf("commands:")
|
logger.Outf("commands:")
|
||||||
for _, c := range cmds {
|
for _, c := range cmds {
|
||||||
if c.Cmd != "" {
|
isCommand := c.Cmd != ""
|
||||||
|
if isCommand {
|
||||||
logger.Outf(" - %s", c.Cmd)
|
logger.Outf(" - %s", c.Cmd)
|
||||||
} else {
|
} else {
|
||||||
logger.Outf(" - Task: %s", c.Task)
|
logger.Outf(" - Task: %s", c.Task)
|
||||||
|
@ -123,19 +123,22 @@ func TestFullSummary(t *testing.T) {
|
|||||||
|
|
||||||
summary.Print(&l, task)
|
summary.Print(&l, task)
|
||||||
|
|
||||||
|
assert.Equal(t, expectedOutput(), buffer.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
func expectedOutput() string {
|
||||||
expected :=
|
expected :=
|
||||||
`task: sample-task
|
`task: sample-task
|
||||||
|
|
||||||
line1
|
line1
|
||||||
line2
|
line2
|
||||||
line3
|
line3
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- dependency
|
- dependency
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
- command
|
- command
|
||||||
`
|
`
|
||||||
|
return expected
|
||||||
assert.Equal(t, expected, buffer.String())
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user