From 014ab7935e9baac6fed17b03a9cb2f833646851b Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Thu, 11 Apr 2019 21:59:23 -0700 Subject: [PATCH] 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. --- tests/expansion.err | 14 ++++++++++++++ tests/expansion.in | 6 ++++++ tests/expansion.out | 3 +++ 3 files changed, 23 insertions(+) diff --git a/tests/expansion.err b/tests/expansion.err index 753d83cf8..d898fab04 100644 --- a/tests/expansion.err +++ b/tests/expansion.err @@ -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 {}} + ^ + diff --git a/tests/expansion.in b/tests/expansion.in index 830a1197e..dc7bf48ef 100644 --- a/tests/expansion.in +++ b/tests/expansion.in @@ -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 \ No newline at end of file diff --git a/tests/expansion.out b/tests/expansion.out index d46187a22..6feca2540 100644 --- a/tests/expansion.out +++ b/tests/expansion.out @@ -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