diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-11 18:32:57 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-11 18:32:57 +0200 |
| commit | 1ad72842b3dcf10cc89cd682a044f4780ac97e41 (patch) | |
| tree | 80c7ecbff4c3e20e3f6da86a96a3c7542c92500b /src/hooks.py | |
| parent | 1739695001889d53d29976943fda593d64afcefb (diff) | |
| download | minishell_test-1ad72842b3dcf10cc89cd682a044f4780ac97e41.tar.gz minishell_test-1ad72842b3dcf10cc89cd682a044f4780ac97e41.tar.bz2 minishell_test-1ad72842b3dcf10cc89cd682a044f4780ac97e41.zip | |
Added export alone, quote missing and tab in cmd test
Diffstat (limited to 'src/hooks.py')
| -rw-r--r-- | src/hooks.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/hooks.py b/src/hooks.py index b723b99..7ee1334 100644 --- a/src/hooks.py +++ b/src/hooks.py @@ -6,16 +6,19 @@ # By: charles <me@cacharle.xyz> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/11 16:10:20 by charles #+# #+# # -# Updated: 2020/09/11 17:06:03 by charles ### ########.fr # +# Updated: 2020/09/11 18:26:58 by charles ### ########.fr # # # # ############################################################################ # +import regex + import config def sort_lines(output): return '\n'.join(sorted(output.split('\n'))) + def error_line0(output): lines = output.split('\n') if len(lines) != 3: @@ -25,5 +28,13 @@ def error_line0(output): return output return lines[0].replace(prefix, "minishell: ") + "\n" + def discard(output): return "DISCARDED BY TEST" + + +def export_singleton(output): + return sort_lines( + '\n'.join([l for l in output.split('\n') + if regex.match("^declare -x .+=\".*\"$", l) is not None]) + ) |
