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 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/hooks.py') 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 -- cgit