mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
Disallow backgrounding in conditionals and before and/or bool statements
Fixes #1136
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user