aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-11-02 13:11:27 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-11-02 13:11:27 -0800
commitc31ad3ed07a88f4dad5a998f005fb8c195fd1eb2 (patch)
tree078e45a3ebc4e4c71b76ade89c6e4ed11760d30f /fish_tests.cpp
parentc33a3862ccc1e694ecf31f6d0b6cf1a45d6455f7 (diff)
Disallow backgrounding in conditionals and before and/or bool statements
Fixes #1136
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp30
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