diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-12 11:04:21 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-12 11:04:21 +0200 |
| commit | 75f6b134911e378cb384e41fd0b9f717341acb2d (patch) | |
| tree | 2563065b514e314769c673f541cbcc40eb999298 | |
| parent | d66394dc10517af4578e80d626dc903a3cdece79 (diff) | |
| download | minishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.tar.gz minishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.tar.bz2 minishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.zip | |
Added recording, Fixing no autocomplete on exact match
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | recording.gif | bin | 0 -> 6275302 bytes | |||
| -rw-r--r-- | screenshot.png | bin | 28402 -> 0 bytes | |||
| -rw-r--r-- | src/suite/suite.py | 14 | ||||
| -rw-r--r-- | src/suites/cmd.py | 9 | ||||
| -rw-r--r-- | src/suites/preprocess.py | 8 |
6 files changed, 25 insertions, 8 deletions
@@ -2,7 +2,7 @@ Test for the minishell project of school 42. - + ## Usage diff --git a/recording.gif b/recording.gif Binary files differnew file mode 100644 index 0000000..618bd36 --- /dev/null +++ b/recording.gif diff --git a/screenshot.png b/screenshot.png Binary files differdeleted file mode 100644 index 406f37c..0000000 --- a/screenshot.png +++ /dev/null diff --git a/src/suite/suite.py b/src/suite/suite.py index c482c64..ee13268 100644 --- a/src/suite/suite.py +++ b/src/suite/suite.py @@ -6,7 +6,7 @@ # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:29 by charles #+# #+# # -# Updated: 2020/09/12 10:38:16 by charles ### ########.fr # +# Updated: 2020/09/12 10:53:42 by charles ### ########.fr # # # # ############################################################################ # @@ -32,12 +32,16 @@ class Suite: if len(asked_names) == 0: asked_names = [s.name for s in cls.available] + suite_names = [s.name for s in cls.available] names = [] for i, name in enumerate(asked_names): - matches = [s.name for s in cls.available - if s.name.find("/") != -1 - and s.name[s.name.find("/") + 1:].startswith(name) - or s.name.startswith(name)] + if name in suite_names: + names.append(name) + continue + matches = [n for n in suite_names + if n.find("/") != -1 + and n[n.find("/") + 1:].startswith(name) + or n.startswith(name)] if len(matches) == 1: names.append(matches[0]) elif len(matches) != 0 and all([n.startswith(name) for n in matches]): diff --git a/src/suites/cmd.py b/src/suites/cmd.py index 2493a0e..d8770d4 100644 --- a/src/suites/cmd.py +++ b/src/suites/cmd.py @@ -6,13 +6,14 @@ # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 15:11:46 by charles #+# #+# # -# Updated: 2020/09/12 01:31:00 by charles ### ########.fr # +# Updated: 2020/09/12 10:51:19 by charles ### ########.fr # # # # ############################################################################ # import distutils import hooks +import config from suite import suite @@ -94,6 +95,12 @@ def suite_cmd(test): test("echo foo >bar", files=["bar"]) test("echo foo> bar", files=["bar"]) test("echo foo > bar", files=["bar"]) + test("echo a as df sad f as df qw e qwe as df asd f as df as d fas d f" + "asd f asd f asdf asdf asdf asd f asd f asd f asd f as df as df a" + "asd f asd f asdf asdf asdf asd f asd f asd f asd f as df as df a" + "asd f asd f asdf asdf asdf asd f asd f asd f asd f as df as df a") + test("echo " + config.LOREM * 10) + test("echo " + config.LOREM * 20) @suite() diff --git a/src/suites/preprocess.py b/src/suites/preprocess.py index a407809..406e390 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/09/11 20:15:08 by charles ### ########.fr # +# Updated: 2020/09/12 10:48:04 by charles ### ########.fr # # # # **************************************************************************** # @@ -27,6 +27,8 @@ def suite_quote(test): test('echo "\\""') test('echo "\\$"') test('echo "\\\\"') + test('echo "\\a"') + test('echo "\\A"') test('ls ""') test("ls ''") test('ls "" "" "" \'\' """"') @@ -49,6 +51,10 @@ def suite_quote(test): test('ec""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ho bonjour') test("'''''''e''''''''''c''''''''''''h''''''''o''''''''''''''''''''' bonjour") test('"""""""e""""""""""c""""""""""""h""""""""o""""""""""""""""""""" bonjour') + test("echo '\"'") + test("echo '\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"'") + test('echo "\'"') + test('echo "\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'"') test("echo '", hook=hooks.error_line0) test('echo "', hook=hooks.error_line0) test("echo '''", hook=hooks.error_line0) |
