From 1927ebbc5dda3b130241cc3e0bbf6002662cd98f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 14 Oct 2014 00:37:01 -0700 Subject: Improve error reporting for unclosed blocks --- tests/test9.in | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/test9.in') diff --git a/tests/test9.in b/tests/test9.in index 95a75843..35df1737 100644 --- a/tests/test9.in +++ b/tests/test9.in @@ -97,4 +97,15 @@ else echo 'psub file was deleted' end +# Test support for unbalanced blocks +function try_unbalanced_block + ../fish -c "echo $argv | source " 2>&1 | grep "Missing end" 1>&2 +end +try_unbalanced_block 'begin' +try_unbalanced_block 'while true' +try_unbalanced_block 'for x in 1 2 3' +try_unbalanced_block 'switch abc' +try_unbalanced_block 'function anything' +try_unbalanced_block 'if false' + false -- cgit v1.2.3