aboutsummaryrefslogtreecommitdiff
path: root/src/suites/flow.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-07 08:29:32 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-07 08:32:55 +0200
commit06f6eeee3a7aaea881d7b399454762f65c8cec87 (patch)
tree5fcdf9a6283d61069c1226c4876c99af0da2ab83 /src/suites/flow.py
parent058491e35baa8bc73e14b48ceb765a3fe3c07e1f (diff)
downloadminishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.tar.gz
minishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.tar.bz2
minishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.zip
Added Linux exit status and output conversion to macos
Diffstat (limited to 'src/suites/flow.py')
-rw-r--r--src/suites/flow.py74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/suites/flow.py b/src/suites/flow.py
index 4f61283..64eda86 100644
--- a/src/suites/flow.py
+++ b/src/suites/flow.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:52 by charles #+# #+# #
-# Updated: 2020/10/06 16:16:12 by cacharle ### ########.fr #
+# Updated: 2020/10/07 08:23:50 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -23,9 +23,9 @@ def suite_end(test):
test("echo; ")
test("echo ; ")
test("echo ;")
- test("; echo", hook=hooks.error_line0)
- test(" ;echo", hook=hooks.error_line0)
- test(" ; echo", hook=hooks.error_line0)
+ test("; echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(" ;echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(" ; echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("echo a; echo b; echo c; echo d; echo e; echo f; echo g; echo h; echo i;"
"echo j; echo k; echo l; echo m; echo c; echo c; echo c; echo c; echo c;"
"echo c; echo c; echo c; echo v; echo w; echo x; echo y; echo z")
@@ -35,17 +35,17 @@ def suite_end(test):
test("ls doesnotexists ; echo bonjour")
test("ls doesnotexists; echo bonjour")
test("echo bonjour; ls doesnotexists")
- test("echo a ; ;", hook=hooks.error_line0)
- test("echo a ; ;", hook=hooks.error_line0)
- test(";", hook=hooks.error_line0)
- test("; ;", hook=hooks.error_line0)
- test("; ; ;", hook=hooks.error_line0)
- test("echo a ; ; echo b", hook=hooks.error_line0)
- test(";;", hook=[hooks.error_line0, hooks.replace_double_semi_colon])
- test(";;;", hook=[hooks.error_line0, hooks.replace_double_semi_colon])
- test(";;;;;", hook=[hooks.error_line0, hooks.replace_double_semi_colon])
- test("echo a ;; echo b", hook=[hooks.error_line0, hooks.replace_double_semi_colon])
- test("echo a ;;;;; echo b", hook=[hooks.error_line0, hooks.replace_double_semi_colon])
+ test("echo a ; ;", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("echo a ; ;", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(";", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("; ;", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("; ; ;", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("echo a ; ; echo b", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(";;", hook=[hooks.error_line0, hooks.replace_double_semi_colon], hook_status=hooks.platform_status(2, 1))
+ test(";;;", hook=[hooks.error_line0, hooks.replace_double_semi_colon], hook_status=hooks.platform_status(2, 1))
+ test(";;;;;", hook=[hooks.error_line0, hooks.replace_double_semi_colon], hook_status=hooks.platform_status(2, 1))
+ test("echo a ;; echo b", hook=[hooks.error_line0, hooks.replace_double_semi_colon], hook_status=hooks.platform_status(2, 1))
+ test("echo a ;;;;; echo b", hook=[hooks.error_line0, hooks.replace_double_semi_colon], hook_status=hooks.platform_status(2, 1))
test("ls " + 40 * " ; ls", setup="touch a b c")
test("ls " + 80 * " ; ls", setup="touch a b c")
test("ls " + 40 * " ; ls" + ";", setup="touch a b c")
@@ -69,18 +69,18 @@ def suite_pipe(test):
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")
- test("echo|", hook=hooks.discard)
- test("echo |", hook=hooks.discard)
- test("echo | ", hook=hooks.discard)
- test("|cat", hook=hooks.error_line0)
- test("| cat", hook=hooks.error_line0)
- test(" | cat", hook=hooks.error_line0)
+ test("echo|", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo |", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo | ", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("|cat", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("| cat", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(" | cat", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("echo a | export A=a; echo $A")
test("export A=a | cat; echo $A")
- test("echo bonjour | | cat -e", hook=hooks.error_line0)
+ test("echo bonjour | | cat -e", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("echo bonjour | asdf")
test("asdf | echo bonjour")
- test("echo a ||| echo b", hook=hooks.error_line0)
+ test("echo a ||| echo b", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("ls " + 40 * " | ls", setup="touch a b c")
test("ls " + 80 * " | ls", setup="touch a b c")
test("echo bonjour " + 40 * " | cat -e")
@@ -92,13 +92,13 @@ def suite_and(test):
test("echo bonjour&& echo je")
test("echo bonjour &&echo je")
test("echo bonjour && echo je")
- test("echo bonjour&&", hook=hooks.discard)
- test("echo&& ", hook=hooks.discard)
- test("echo && ", hook=hooks.discard)
- test("echo &&", hook=hooks.discard)
- test("&&echo", hook=hooks.error_line0)
- test("&& echo", hook=hooks.error_line0)
- test(" && echo", hook=hooks.error_line0)
+ test("echo bonjour&&", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo&& ", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo && ", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo &&", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("&&echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("&& echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(" && echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("echo a&& echo b&& echo c&& echo d&& echo e&& echo f&& echo g&& echo h&& echo i&&"
"echo j&& echo k&& echo l&& echo m&& echo c&& echo c&& echo c&& echo c&& echo c&&"
"echo c&& echo c&& echo c&& echo v&& echo w&& echo x&& echo y&& echo z")
@@ -117,13 +117,13 @@ def suite_or(test):
test("echo bonjour|| echo je")
test("echo bonjour ||echo je")
test("echo bonjour || echo je")
- test("echo bonjour||", hook=hooks.discard)
- test("echo|| ", hook=hooks.discard)
- test("echo || ", hook=hooks.discard)
- test("echo ||", hook=hooks.discard)
- test("||echo", hook=hooks.error_line0)
- test("|| echo", hook=hooks.error_line0)
- test(" || echo", hook=hooks.error_line0)
+ test("echo bonjour||", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo|| ", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo || ", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("echo ||", hook=hooks.discard, hook_status=hooks.platform_status(2, 1))
+ test("||echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test("|| echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
+ test(" || echo", hook=hooks.error_line0, hook_status=hooks.platform_status(2, 1))
test("echo a|| echo b|| echo c|| echo d|| echo e|| echo f|| echo g|| echo h|| echo i||"
"echo j|| echo k|| echo l|| echo m|| echo c|| echo c|| echo c|| echo c|| echo c||"
"echo c|| echo c|| echo c|| echo v|| echo w|| echo x|| echo y|| echo z")