From c2d6bf590ee30b195bf8f64364ca9d898b35736f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 25 Nov 2020 21:37:49 +0100 Subject: #6 Added special characters field split and should_not_be hook, to avoid error message --- src/hooks.py | 10 +++++++++- src/suites/preprocess.py | 7 ++++++- 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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") -- cgit