From 55fab322485f67112c789a4a529765b5e6635238 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 13 Sep 2020 17:47:01 +0200 Subject: Added C macro to detect when minishell is tested inside of code --- src/suites/flow.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/suites/flow.py') diff --git a/src/suites/flow.py b/src/suites/flow.py index cf8ca61..55c5647 100644 --- a/src/suites/flow.py +++ b/src/suites/flow.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:52 by charles #+# #+# # -# Updated: 2020/09/12 15:30:37 by charles ### ########.fr # +# Updated: 2020/09/13 17:19:09 by charles ### ########.fr # # # # ############################################################################ # @@ -35,6 +35,7 @@ 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) @suite() @@ -61,6 +62,11 @@ def suite_pipe(test): test("export A=a | cat; echo $A") # test("echo a | A=a; echo $A") # test("A=a | cat; echo $A") + test("ls " + 40 * " | ls") + test("ls " + 80 * " | ls") + test("echo bonjour " + 40 * " | cat -e") + test("echo bonjour " + 80 * " | cat -e") + test("echo bonjour | | cat -e", hook=hooks.error_line0) @suite(bonus=True) @@ -148,3 +154,7 @@ def suite_parenthesis(test): test("(ls doesntexist || ls)") test("(ls doesntexist && ls)") test("(ls && ls) && echo $?") + test("(echo a; echo b) | cat -e") + test("echo bonjour | (cat -e; echo a)") + test("echo bonjour | (echo a; cat -e)") + test("(echo bonjour ; echo aurevoir) | (cat -e | cat -e) | cat -e") -- cgit