Test expansion syntax errors.

If there is a better way to do stuff that will stop execution than
fish -c for our tests, please let me know.
This commit is contained in:
Aaron Gyes 2019-04-11 21:59:23 -07:00
parent 1834e962d2
commit 014ab7935e
3 changed files with 23 additions and 0 deletions

View File

@ -25,3 +25,17 @@ echo $$paren
####################
# Test path variables
####################
# Test fatal syntax errors
fish: $, is not a valid variable in fish.
echo $,foo
^
fish: Unexpected end of string, incomplete parameter expansion
echo {
^
fish: Unexpected '}' for unopened brace expansion
echo {}}
^

View File

@ -148,3 +148,9 @@ set testvar "$testvar:FOUR"
echo "Appended path: $testvar" (count $testvar)
set --unpath testvar $testvar
echo "Back to normal variable: $testvar" (count $testvar)
logmsg Test fatal syntax errors
../test/root/bin/fish -c 'echo $,foo'
../test/root/bin/fish -c 'echo {'
../test/root/bin/fish -c 'echo {}}'
true

View File

@ -87,3 +87,6 @@ Not a path: ONE:TWO:THREE 1
As a path: ONE:TWO:THREE 3
Appended path: ONE:TWO:THREE:FOUR 4
Back to normal variable: ONE TWO THREE FOUR 4
####################
# Test fatal syntax errors