this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cmd/cue: test `cue` and `cue cmd` via testscript

Some of the logic in newCmdCmd wasn't covered by our tests yet.
Do that, verifying that the behavior is still correct.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ifdbd7f52a2a36b8527f41b013ac6494b4eda526a
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1191110
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>

+12 -3
-1
cmd/cue/cmd/cmd.go
··· 139 139 // depending on whether we ran via `cue cmd` or the `cue` shortcut. 140 140 isRootCmd := cmd.Command == cmd.root 141 141 142 - // TODO(mvdan): test running `cue` and `cue cmd` via testscript as well 143 142 if len(args) == 0 { 144 143 // `cue` should print the top-level help like `cue -h`, 145 144 // but `cue cmd` should explain that a custom command is required.
+3
cmd/cue/cmd/testdata/script/help.txtar
··· 1 1 # Verify that the various forms of requesting help work 2 2 3 + exec cue 4 + cmp stdout stdout.golden 5 + 3 6 exec cue help 4 7 cmp stdout stdout.golden 5 8
+9 -2
cmd/cue/cmd/testdata/script/help_cmd.txtar
··· 1 + ! exec cue cmd 2 + ! stdout . 3 + cmp stderr cue-cmd.stderr 4 + 1 5 exec cue help cmd 2 - cmp stdout expect-stdout 6 + cmp stdout cue-help-cmd.stdout 3 7 4 8 -- cue.mod/module.cue -- 5 9 -- task_tool.cue -- ··· 23 27 } 24 28 } 25 29 26 - -- expect-stdout -- 30 + -- cue-cmd.stderr -- 31 + cmd must be run as one of its subcommands 32 + Run 'cue help cmd' for known subcommands. 33 + -- cue-help-cmd.stdout -- 27 34 cmd executes the named command for each of the named instances. 28 35 29 36 Commands define actions on instances. For example, they may