From 75f6b134911e378cb384e41fd0b9f717341acb2d Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 12 Sep 2020 11:04:21 +0200 Subject: Added recording, Fixing no autocomplete on exact match --- src/suite/suite.py | 14 +++++++++----- src/suites/cmd.py | 9 ++++++++- src/suites/preprocess.py | 8 +++++++- 3 files changed, 24 insertions(+), 7 deletions(-) (limited to 'src') 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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) -- cgit