aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-11-25 21:37:49 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-11-25 21:37:49 +0100
commitc2d6bf590ee30b195bf8f64364ca9d898b35736f (patch)
tree7da77a3c507187bd400ece0e3adc1d9cbd09c649 /src
parentcaa8b47a9fbc8a2b5f1b6a105130699905243e8f (diff)
downloadminishell_test-c2d6bf590ee30b195bf8f64364ca9d898b35736f.tar.gz
minishell_test-c2d6bf590ee30b195bf8f64364ca9d898b35736f.tar.bz2
minishell_test-c2d6bf590ee30b195bf8f64364ca9d898b35736f.zip
#6 Added special characters field split and should_not_be hook, to avoid error message
Diffstat (limited to 'src')
-rw-r--r--src/hooks.py10
-rw-r--r--src/suites/preprocess.py7
2 files changed, 15 insertions, 2 deletions
diff --git a/src/hooks.py b/src/hooks.py
index 9e80dd0..e37f2aa 100644
--- a/src/hooks.py
+++ b/src/hooks.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 16:10:20 by charles #+# #+# #
-# Updated: 2020/10/24 13:16:59 by charles ### ########.fr #
+# Updated: 2020/11/25 21:36:18 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -113,3 +113,11 @@ def linux_discard(output):
return "DISCARDED BY MINISHELL TEST"
else:
return output
+
+
+def should_not_be(not_expected):
+ def hook(output):
+ if output == not_expected:
+ return "OUTPUT SHOULD NOT BE " + output
+ return "DISCARDED BY TEST"
+ return hook
diff --git a/src/suites/preprocess.py b/src/suites/preprocess.py
index 89130ec..3e038a8 100644
--- a/src/suites/preprocess.py
+++ b/src/suites/preprocess.py
@@ -6,7 +6,7 @@
# By: juligonz <juligonz@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:25:00 by charles #+# #+# #
-# Updated: 2020/10/09 12:39:07 by cacharle ### ########.fr #
+# Updated: 2020/11/25 21:35:32 by charles ### ########.fr #
# #
# **************************************************************************** #
@@ -236,6 +236,11 @@ def suite_spaces(test):
test("\t\t\t\t\t\techo\tfoo")
test("echo\tfoo\t\t\t\t\t\t")
test("\t\t\t\techo\t\t\t\tfoo\t\t\t\t")
+ test("\fecho\ffoo", hook=hooks.should_not_be("foo\n"))
+ test("\necho\nfoo", hook=hooks.should_not_be("foo\n"))
+ test("\recho\rfoo", hook=hooks.should_not_be("foo\n"))
+ test("\vecho\vfoo", hook=hooks.should_not_be("foo\n"))
+ test("\t\r\v\fecho\v\t\r\vfoo", hook=hooks.should_not_be("foo\n"))
test("")
test(" ")
test("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t")