this repo has no description
0
fork

Configure Feed

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

cmd/cue: test tool/exec.Run with arguments involving spaces

The command is expected to fail, as we run the "false" program
which always fails and ignores any arguments.

The printed error is ambiguous, as it's not possible to see
what the original list of arguments was, hence the TODO.
The following commit will resolve this bug.

For #3238.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie277772ce58dfac48df9440e0a53fd9f1fc309cc
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197451
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+13 -1
+2 -1
cmd/cue/cmd/testdata/script/cmd_errcode.txtar
··· 16 16 kind: "exec" 17 17 cmd: "ls --badflags" 18 18 stderr: string // suppress error message 19 - }} 19 + } 20 + }
+11
cmd/cue/cmd/testdata/script/cmd_execerr.txtar
··· 4 4 exec cue cmd canFail 5 5 cmp stdout canFail-stdout.golden 6 6 7 + # TODO(mvdan): the error message should quote the argument list 8 + # so that any arguments with spaces do not introduce ambiguity. 9 + ! exec cue cmd withSpaces 10 + cmp stderr withSpaces-stderr.golden 11 + 7 12 -- cue.mod/module.cue -- 8 13 module: "example.com" 9 14 language: version: "v0.9.0" ··· 18 23 errNotFound: 19 24 success=false 20 25 hasStderr=true 26 + -- withSpaces-stderr.golden -- 27 + task failed: command "false with an ignored argument" failed: exit status 1 21 28 -- foo_tool.cue -- 22 29 package foo 23 30 ··· 55 62 """ 56 63 } 57 64 } 65 + 66 + command: withSpaces: exec.Run & { 67 + cmd: ["false", "with an ignored argument"] 68 + }