aboutsummaryrefslogtreecommitdiff
path: root/suites/parenthesis.py
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-23 09:08:16 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-23 10:31:05 +0200
commit3f2db95d5563c9c2b92a0531ddee28f79f438706 (patch)
treeee353ad4a0fcca9d59758f2e98efa3d9907096fc /suites/parenthesis.py
parentb463bfa34471c1d3e65dfd4e22a99f4c84d7c5c6 (diff)
downloadminishell_test-3f2db95d5563c9c2b92a0531ddee28f79f438706.tar.gz
minishell_test-3f2db95d5563c9c2b92a0531ddee28f79f438706.tar.bz2
minishell_test-3f2db95d5563c9c2b92a0531ddee28f79f438706.zip
Added a few builtin/parenthesis tests
Diffstat (limited to 'suites/parenthesis.py')
-rw-r--r--suites/parenthesis.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/suites/parenthesis.py b/suites/parenthesis.py
index c1df83b..30f1cce 100644
--- a/suites/parenthesis.py
+++ b/suites/parenthesis.py
@@ -14,5 +14,32 @@ def suite_parenthesis(test):
test("ls doesnotexist || (echo b && echo c)")
test("(echo bonjour > f1)", files=["f1"])
+ test("(echo bonjour > f1 > f2 > f3)", files=["f1", "f2", "f3"])
+ test("(echo bonjour > f1 > f2 > f3 > f4 > f5 > f6 > f7 > f8 > f9)",
+ files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"])
+
+ test("(echo bonjour) > f1", files=["f1"])
+ test("(echo bonjour) > f1 > f2 > f3", files=["f1", "f2", "f3"])
+ test("(echo bonjour) > f1 > f2 > f3 > f4 > f5 > f6 > f7 > f8 > f9",
+ files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"])
+
+ test("(cat -e < f1)", setup="echo bonjour > f1")
+ test("(cat -e < f1 < f2 < f3)", setup="touch f1 f2 f3 f4; echo bonjour > f3")
+ test("(cat -e < f1 < f2 < f3 < f4 < f5 < f6 < f7 < f8 < f9)",
+ setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9")
+
+ test("(cat -e) < f1", setup="echo bonjour > f1")
+ test("(cat -e) < f1 < f2 < f3", setup="touch f1 f2 f3 f4; echo bonjour > f3")
+ test("(cat -e) < f1 < f2 < f3 < f4 < f5 < f6 < f7 < f8 < f9",
+ setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9")
+
+ test("(echo bonjour > f1 > f2 > f3 > f4) > f5 > f6 > f7 > f8 > f9",
+ files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"])
+ test("(cat -e < f1 < f2 < f3 < f4) < f5 < f6 < f7 < f8 < f9",
+ setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f4")
+
test("(echo bonjour > f1) > f2", files=["f1", "f2"])
test("(cat -e > f1) < f2", setup="ls -l / > f2", files=["f1"])
+
+ test("(exit); echo bonjour")
+ test("(echo bonjour; exit; echo aurevoir)")