From b463bfa34471c1d3e65dfd4e22a99f4c84d7c5c6 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 19 Jun 2020 17:21:58 +0200 Subject: Added a few parenthesis tests --- main.py | 1 + suites/parenthesis.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 suites/parenthesis.py diff --git a/main.py b/main.py index 617e02a..9674c03 100755 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ from suite import Suite import suites.builtin import suites.suites import suites.operation +import suites.parenthesis def main(): if not os.path.exists(config.EXECUTABLES_PATH): diff --git a/suites/parenthesis.py b/suites/parenthesis.py new file mode 100644 index 0000000..c1df83b --- /dev/null +++ b/suites/parenthesis.py @@ -0,0 +1,18 @@ +from suite import suite + +@suite +def suite_parenthesis(test): + test("(echo bonjour)") + test("(echo bonjour )") + test("( echo bonjour )") + + test("(echo a && echo b) && echo c") + test("(echo a || echo b) || echo c") + test("(ls doesnotexist || echo b) || echo c") + test("(echo a || ls doesnotexist) || echo c") + test("echo aa && (echo b && echo c)") + test("ls doesnotexist || (echo b && echo c)") + + test("(echo bonjour > f1)", files=["f1"]) + test("(echo bonjour > f1) > f2", files=["f1", "f2"]) + test("(cat -e > f1) < f2", setup="ls -l / > f2", files=["f1"]) -- cgit