From 310ddc2208bd40e3950ebf89efe62f747be8277f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 15 Oct 2020 09:36:10 +0200 Subject: Added case insensitive PATH search tests --- src/suites/builtin.py | 18 +++++++++++++++++- src/suites/cmd.py | 4 +++- src/suites/path.py | 11 ++++++++++- src/test/captured.py | 2 +- src/test/test.py | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) (limited to 'src') 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # 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 # # # # ############################################################################ # -- cgit