aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-15 09:36:10 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-15 09:36:34 +0200
commit310ddc2208bd40e3950ebf89efe62f747be8277f (patch)
tree5adab20a92a99435c627a11f0db09897cfb3f56d /src
parenta36a27b8ca85adf57b2a9926a53e74e3a3863d3d (diff)
downloadminishell_test-310ddc2208bd40e3950ebf89efe62f747be8277f.tar.gz
minishell_test-310ddc2208bd40e3950ebf89efe62f747be8277f.tar.bz2
minishell_test-310ddc2208bd40e3950ebf89efe62f747be8277f.zip
Added case insensitive PATH search tests
Diffstat (limited to 'src')
-rw-r--r--src/suites/builtin.py18
-rw-r--r--src/suites/cmd.py4
-rw-r--r--src/suites/path.py11
-rw-r--r--src/test/captured.py2
-rw-r--r--src/test/test.py2
5 files changed, 32 insertions, 5 deletions
diff --git a/src/suites/builtin.py b/src/suites/builtin.py
index 1723b13..e6d2ffe 100644
--- a/src/suites/builtin.py
+++ b/src/suites/builtin.py
@@ -6,7 +6,7 @@
# By: juligonz <juligonz@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:43 by charles #+# #+# #
-# Updated: 2020/10/09 20:28:36 by charles ### ########.fr #
+# Updated: 2020/10/15 08:49:44 by cacharle ### ########.fr #
# Updated: 2020/09/11 18:01:27 by juligonz ### ########.fr #
# #
# **************************************************************************** #
@@ -41,6 +41,22 @@ def suite_echo(test):
test("echo -n a '' b '' c '' d")
test('echo -n a "" b "" c "" d')
test("echo '' '' ''")
+ test("Echo bonjour")
+ test("eCho bonjour")
+ test("ecHo bonjour")
+ test("echO bonjour")
+ test("EchO bonjour")
+ test("eCHo bonjour")
+ test("EcHo bonjour")
+ test("eChO bonjour")
+ test("Echo bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("eCho bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("ecHo bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("echO bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("EchO bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("eCHo bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("EcHo bonjour", exports={"PATH": "/bin:/usr/bin"})
+ test("eChO bonjour", exports={"PATH": "/bin:/usr/bin"})
@suite()
diff --git a/src/suites/cmd.py b/src/suites/cmd.py
index c4db2a8..b5b770f 100644
--- a/src/suites/cmd.py
+++ b/src/suites/cmd.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 15:11:46 by charles #+# #+# #
-# Updated: 2020/10/08 08:39:36 by cacharle ### ########.fr #
+# Updated: 2020/10/15 09:25:04 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -224,6 +224,8 @@ def suite_cmd_path(test):
test("./somedir", setup='mkdir -m 5777 somedir', hook=hooks.is_directory)
test("./somedir", setup='mkdir -m 6777 somedir', hook=hooks.is_directory)
test("./somedir", setup='mkdir -m 0000 somedir', hook=hooks.is_directory)
+ test("./Somefile", setup='echo > somefile && chmod 000 somefile')
+ test("./someFILE", setup='echo > somefile && chmod 000 somefile')
# @suite(bonus=True)
diff --git a/src/suites/path.py b/src/suites/path.py
index a09c64a..5db1e36 100644
--- a/src/suites/path.py
+++ b/src/suites/path.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/09 15:12:58 by charles #+# #+# #
-# Updated: 2020/10/09 12:58:55 by cacharle ### ########.fr #
+# Updated: 2020/10/15 09:17:09 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -66,6 +66,7 @@ def suite_path(test):
test("a", setup=mode_fmt.format("6777"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("7777"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("0000"), exports={"PATH": "path"})
+ test("A", setup=mode_fmt.format("000"), exports={"PATH": "path"})
# test("b", setup="mkdir path && cp " + whoami_path + " ./path/a && ln -s ./path/a ./path/b",
# exports={"PATH": "path"})
test("b", setup="mkdir path && ln -s " + whoami_path + " ./path/b", exports={"PATH": "path"})
@@ -123,3 +124,11 @@ def suite_path_variable(test):
test("somecmd", setup=create_cmd_setup, exports={"PATH": "/bin:"})
test("somecmd", setup=create_cmd_setup, exports={"PATH": ":/bin"})
test("somecmd", setup=create_cmd_setup, exports={"PATH": ":/bin:"})
+ test("Whoami", exports={"PATH": "/usr/bin"})
+ test("wHoAMi", exports={"PATH": "/usr/bin"})
+ test("whoami", exports={"PATH": "/usr/bIn"})
+ test("whoami", exports={"PATH": "/Usr/bin"})
+ test("Whoami", exports={"PATH": "/usr/bIn"})
+ test("wHoami", exports={"PATH": "/Usr/bin"})
+ test("Whoami", exports={"PATH": ""})
+ test("wHoami", exports={"PATH": ""})
diff --git a/src/test/captured.py b/src/test/captured.py
index 15ef3f7..a3932fd 100644
--- a/src/test/captured.py
+++ b/src/test/captured.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 12:16:25 by charles #+# #+# #
-# Updated: 2020/10/11 08:44:36 by cacharle ### ########.fr #
+# Updated: 2020/10/15 08:49:01 by cacharle ### ########.fr #
# #
# ############################################################################ #
diff --git a/src/test/test.py b/src/test/test.py
index 238ba66..c101193 100644
--- a/src/test/test.py
+++ b/src/test/test.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/06/16 21:48:50 by charles #+# #+# #
-# Updated: 2020/10/11 14:09:04 by cacharle ### ########.fr #
+# Updated: 2020/10/15 08:50:05 by cacharle ### ########.fr #
# #
# ############################################################################ #