aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--recording.gifbin0 -> 6275302 bytes
-rw-r--r--screenshot.pngbin28402 -> 0 bytes
-rw-r--r--src/suite/suite.py14
-rw-r--r--src/suites/cmd.py9
-rw-r--r--src/suites/preprocess.py8
6 files changed, 25 insertions, 8 deletions
diff --git a/README.md b/README.md
index 74056f5..d4a19b8 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Test for the minishell project of school 42.
-![screenshot](./screenshot.png)
+![screenshot](recording.gif)
## Usage
diff --git a/recording.gif b/recording.gif
new file mode 100644
index 0000000..618bd36
--- /dev/null
+++ b/recording.gif
Binary files differ
diff --git a/screenshot.png b/screenshot.png
deleted file mode 100644
index 406f37c..0000000
--- a/screenshot.png
+++ /dev/null
Binary files differ
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)