Unallowed command subst error: add missing newline and simplify

Fixes ommitted newline char shown after complete -n'(foo)'
Also axes the 'contains syntax errors' line before the error.
Update tests

before
> complete -n'(foo)'
complete: Condition '(foo)' contained a syntax error
complete: Command substitutions not allowed⏎

after
> complete -n'(foo)'
complete: -n '(foo)': command substitutions not allowed here
This commit is contained in:
Aaron Gyes
2022-10-26 19:50:46 -07:00
parent b2a4a50daf
commit 92698dff48
5 changed files with 12 additions and 13 deletions

View File

@@ -19,15 +19,15 @@ echo 'true | time false' | $fish 2>| string replace -r '(.*)' '<$1>'
echo '
(true one)
FOO=BAR (true one)
(true two)
# more things
' | $fish 2>| string replace -r '(.*)' '<$1>'
# CHECK: <fish: Command substitutions not allowed>
# CHECK: <(true one)>
# CHECK: <^~~~~~~~~^>
# CHECK: <fish: command substitutions not allowed here>
# CHECK: <FOO=BAR (true one)>
# CHECK: < ^~~~~~~~~^>
$fish -c 'echo "unfinished "(subshell' 2>| string replace -r '.*' '<$0>'
# CHECK: <fish: Unexpected end of string, expecting ')'>