aboutsummaryrefslogtreecommitdiff
path: root/src/suites/operation.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-11 14:27:26 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-11 14:27:26 +0200
commitd0a80859f630866461e8a888b3f8fe008c8158ba (patch)
treead0ebcc42a620aeea5a4407e1cacbac24faf1dcb /src/suites/operation.py
parent46ba2708f83bf46186c33bf84975d39e87f467c1 (diff)
downloadminishell_test-d0a80859f630866461e8a888b3f8fe008c8158ba.tar.gz
minishell_test-d0a80859f630866461e8a888b3f8fe008c8158ba.tar.bz2
minishell_test-d0a80859f630866461e8a888b3f8fe008c8158ba.zip
Added suite group and suite bonus, Added signal (not tested)
Diffstat (limited to 'src/suites/operation.py')
-rw-r--r--src/suites/operation.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/suites/operation.py b/src/suites/operation.py
index 3c89589..d58953b 100644
--- a/src/suites/operation.py
+++ b/src/suites/operation.py
@@ -6,13 +6,13 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:52 by charles #+# #+# #
-# Updated: 2020/07/19 10:23:22 by charles ### ########.fr #
+# Updated: 2020/09/11 14:19:14 by charles ### ########.fr #
# #
# ############################################################################ #
from suite import suite
-@suite
+@suite()
def suite_end(test):
test("echo bonjour; echo je")
test("echo bonjour ;echo je")
@@ -35,7 +35,30 @@ def suite_end(test):
test("ls doesnotexists; echo bonjour")
test("echo bonjour; ls doesnotexists")
-@suite
+@suite()
+def suite_pipe(test):
+ test("echo bonjour | cat")
+ test("echo bonjour | cat -e")
+ test("ls | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
+ test("ls -l | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
+ test("ls -l | cat -e | cat | cat | cat", setup="touch a b c d; mkdir m1 m2 m3")
+ test("ls -l | cat -e | cat -e | cat -e | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
+ test("ls -l | cat -e < a", setup="touch a b c d; mkdir m1 m2 m3; echo bonjour > a")
+
+ # TODO special test for potential segfault
+ # test("echo|")
+ # test("echo |")
+ # test("echo | ")
+ test("|cat")
+ test("| cat")
+ test(" | cat")
+
+ test("echo a | export A=a; echo $A")
+ test("export A=a | cat; echo $A")
+ test("echo a | A=a; echo $A")
+ test("A=a | cat; echo $A")
+
+@suite(bonus=True)
def suite_and(test):
test("echo bonjour&& echo je")
test("echo bonjour &&echo je")
@@ -58,7 +81,7 @@ def suite_and(test):
test("ls doesnotexists&& echo bonjour")
test("echo bonjour&& ls doesnotexists")
-@suite
+@suite(bonus=True)
def suite_or(test):
test("echo bonjour|| echo je")
test("echo bonjour ||echo je")
@@ -80,26 +103,3 @@ def suite_or(test):
test("ls doesnotexists || echo bonjour")
test("ls doesnotexists|| echo bonjour")
test("echo bonjour|| ls doesnotexists")
-
-@suite
-def suite_pipe(test):
- test("echo bonjour | cat")
- test("echo bonjour | cat -e")
- test("ls | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
- test("ls -l | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
- test("ls -l | cat -e | cat | cat | cat", setup="touch a b c d; mkdir m1 m2 m3")
- test("ls -l | cat -e | cat -e | cat -e | cat -e", setup="touch a b c d; mkdir m1 m2 m3")
- test("ls -l | cat -e < a", setup="touch a b c d; mkdir m1 m2 m3; echo bonjour > a")
-
- # TODO special test for potential segfault
- # test("echo|")
- # test("echo |")
- # test("echo | ")
- test("|cat")
- test("| cat")
- test(" | cat")
-
- test("echo a | export A=a; echo $A")
- test("export A=a | cat; echo $A")
- test("echo a | A=a; echo $A")
- test("A=a | cat; echo $A")