diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-11-02 13:11:27 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-11-02 13:11:27 -0800 |
commit | c31ad3ed07a88f4dad5a998f005fb8c195fd1eb2 (patch) | |
tree | 078e45a3ebc4e4c71b76ade89c6e4ed11760d30f /fish_tests.cpp | |
parent | c33a3862ccc1e694ecf31f6d0b6cf1a45d6455f7 (diff) |
Disallow backgrounding in conditionals and before and/or bool statements
Fixes #1136
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index 34d505c9..4df8322c 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -691,7 +691,37 @@ static void test_parser() { err(L"Bad escape in nested command substitution not reported as error"); } + + if (! parse_util_detect_errors(L"false & ; and cat")) + { + err(L"'and' command after background not reported as error"); + } + + if (! parse_util_detect_errors(L"true & ; or cat")) + { + err(L"'or' command after background not reported as error"); + } + + if (parse_util_detect_errors(L"true & ; not cat")) + { + err(L"'not' command after background falsely reported as error"); + } + + if (! parse_util_detect_errors(L"if true & ; end")) + { + err(L"backgrounded 'if' conditional not reported as error"); + } + + if (! parse_util_detect_errors(L"if false; else if true & ; end")) + { + err(L"backgrounded 'else if' conditional not reported as error"); + } + + if (! parse_util_detect_errors(L"while true & ; end")) + { + err(L"backgrounded 'while' conditional not reported as error"); + } say(L"Testing basic evaluation"); #if 0 |