aboutsummaryrefslogtreecommitdiff
path: root/src/suites/cmd.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-07 08:29:32 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-07 08:32:55 +0200
commit06f6eeee3a7aaea881d7b399454762f65c8cec87 (patch)
tree5fcdf9a6283d61069c1226c4876c99af0da2ab83 /src/suites/cmd.py
parent058491e35baa8bc73e14b48ceb765a3fe3c07e1f (diff)
downloadminishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.tar.gz
minishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.tar.bz2
minishell_test-06f6eeee3a7aaea881d7b399454762f65c8cec87.zip
Added Linux exit status and output conversion to macos
Diffstat (limited to 'src/suites/cmd.py')
-rw-r--r--src/suites/cmd.py72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/suites/cmd.py b/src/suites/cmd.py
index 196ed85..25ca49b 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/09/28 10:40:39 by cacharle ### ########.fr #
+# Updated: 2020/10/07 08:11:04 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -67,21 +67,21 @@ def suite_redirection(test):
files=["abcdefghijklmnopqrstuvwxyz"])
test("> file", files=["file"])
test("< file", setup="echo bonjour > file")
- test(">", hook=hooks.error_line0)
- test(">>", hook=hooks.error_line0)
- test("<", hook=hooks.error_line0)
- test("echo >", hook=hooks.error_line0)
- test("echo >>", hook=hooks.error_line0)
- test("echo <", hook=hooks.error_line0)
+ test(">", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test(">>", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("<", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("echo >", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("echo >>", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("echo <", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
test("> test", files=["test"])
test(">> test", files=["test"])
test("< test", setup="touch test")
- test("echo foo >>> bar", hook=hooks.error_line0)
- test("echo foo >>>> bar", hook=hooks.error_line0)
- test("echo foo >>>>> bar", hook=hooks.error_line0)
- test("cat << < bar", setup="echo bonjour > bar", hook=hooks.error_line0)
- test("cat << << bar", setup="echo bonjour > bar", hook=hooks.error_line0)
- test("cat <<<<< bar", setup="echo bonjour > bar", hook=hooks.error_line0)
+ test("echo foo >>> bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("echo foo >>>> bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("echo foo >>>>> bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("cat << < bar", setup="echo bonjour > bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("cat << << bar", setup="echo bonjour > bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
+ test("cat <<<<< bar", setup="echo bonjour > bar", hook=hooks.error_line0, hook_status=hooks.platform_status(1, 2))
test("cat < doesnotexist")
@@ -159,15 +159,15 @@ def suite_cmd_path(test):
test("./somefile", setup="echo > somefile; chmod 111 somefile")
test("./somefile", setup="echo > somefile; chmod 222 somefile")
test("./somefile", setup="echo > somefile; chmod 333 somefile")
- test("somedir/", setup="mkdir somedir")
- test("./somedir/", setup="mkdir somedir")
+ test("somedir/", setup="mkdir somedir", hook=hooks.is_directory)
+ test("./somedir/", setup="mkdir somedir", hook=hooks.is_directory)
test("somedir", setup="mkdir somedir")
- test("./somedir", setup="mkdir somedir")
+ test("./somedir", setup="mkdir somedir", hook=hooks.is_directory)
test("somedir", setup="mkdir somedir")
- test("somedirsoftlink/", setup="mkdir somedir; ln -s somedir somedirsoftlink")
- test("./somedirsoftlink/", setup="mkdir somedir; ln -s somedir somedirsoftlink")
+ test("somedirsoftlink/", setup="mkdir somedir; ln -s somedir somedirsoftlink", hook=hooks.is_directory)
+ test("./somedirsoftlink/", setup="mkdir somedir; ln -s somedir somedirsoftlink", hook=hooks.is_directory)
test("somedirsoftlink", setup="mkdir somedir; ln -s somedir somedirsoftlink")
- test("./somedirsoftlink", setup="mkdir somedir; ln -s somedir somedirsoftlink")
+ test("./somedirsoftlink", setup="mkdir somedir; ln -s somedir somedirsoftlink", hook=hooks.is_directory)
test("somedirsoftlink", setup="mkdir somedir; ln -s somedir somedirsoftlink")
test("./someremovedlink", setup="touch somefile; ln -s somefile someremovedlink; rm -f somefile")
test("./somelink2", setup="touch somefile; ln -s somefile somelink1; ln -s somelink1 somelink2")
@@ -187,8 +187,8 @@ def suite_cmd_path(test):
test("'-'", setup="touch -")
test("./_", setup="touch _")
test("./-", setup="touch a; mv a ./-")
- test("./.", setup="touch .")
- test("./..", setup="touch ..")
+ test("./.", setup="touch .", hook=hooks.is_directory)
+ test("./..", setup="touch ..", hook=hooks.is_directory)
test("./somefile", setup='echo > somefile && chmod 0777 somefile')
test("./somefile", setup='echo > somefile && chmod 1000 somefile')
test("./somefile", setup='echo > somefile && chmod 2000 somefile')
@@ -205,21 +205,21 @@ def suite_cmd_path(test):
test("./somefile", setup='echo > somefile && chmod 6777 somefile')
test("./somefile", setup='echo > somefile && chmod 7777 somefile')
test("./somefile", setup='echo > somefile && chmod 0000 somefile')
- test("./somedir", setup='mkdir -m 0777 somedir')
- test("./somedir", setup='mkdir -m 1000 somedir')
- test("./somedir", setup='mkdir -m 2000 somedir')
- test("./somedir", setup='mkdir -m 3000 somedir')
- test("./somedir", setup='mkdir -m 4000 somedir')
- test("./somedir", setup='mkdir -m 5000 somedir')
- test("./somedir", setup='mkdir -m 6000 somedir')
- test("./somedir", setup='mkdir -m 7000 somedir')
- test("./somedir", setup='mkdir -m 1777 somedir')
- test("./somedir", setup='mkdir -m 2777 somedir')
- test("./somedir", setup='mkdir -m 3777 somedir')
- test("./somedir", setup='mkdir -m 4777 somedir')
- test("./somedir", setup='mkdir -m 5777 somedir')
- test("./somedir", setup='mkdir -m 6777 somedir')
- test("./somedir", setup='mkdir -m 0000 somedir')
+ test("./somedir", setup='mkdir -m 0777 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 1000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 2000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 3000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 4000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 5000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 6000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 7000 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 1777 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 2777 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 3777 somedir', hook=hooks.is_directory)
+ test("./somedir", setup='mkdir -m 4777 somedir', hook=hooks.is_directory)
+ 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)
# @suite(bonus=True)