aboutsummaryrefslogtreecommitdiff
path: root/suites/cmd.py
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-07-16 09:23:49 +0200
committerCharles <sircharlesaze@gmail.com>2020-07-16 09:23:49 +0200
commitdf5bd1352d817d12061f4af5bdaf1bf19211ebc1 (patch)
treef1bb53318ccde47901fce658828a1ed157359f40 /suites/cmd.py
parent8a97914ac822703362c22bb6228905f3fbe13d99 (diff)
downloadminishell_test-df5bd1352d817d12061f4af5bdaf1bf19211ebc1.tar.gz
minishell_test-df5bd1352d817d12061f4af5bdaf1bf19211ebc1.tar.bz2
minishell_test-df5bd1352d817d12061f4af5bdaf1bf19211ebc1.zip
Changed bash to sh in cmd_variable tests
Diffstat (limited to 'suites/cmd.py')
-rw-r--r--suites/cmd.py89
1 files changed, 45 insertions, 44 deletions
diff --git a/suites/cmd.py b/suites/cmd.py
index a9fcde7..45941a8 100644
--- a/suites/cmd.py
+++ b/suites/cmd.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 15:11:46 by charles #+# #+# #
-# Updated: 2020/07/15 18:21:56 by charles ### ########.fr #
+# Updated: 2020/07/16 09:06:19 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -109,44 +109,44 @@ def suite_cmd_error(test):
@suite
def suite_cmd_variable(test):
- test("A=a bash -c 'echo $A'")
- test("A=a B=b bash -c 'echo $A$B'")
- test("A=a B=b C=c D=d E=e F=f G=g H=h bash -c 'echo $A$B$C$D$E$F$G$H'")
- test("A=a A=bonjour bash -c 'echo $A'")
- test("A=aA=bonjour bash -c 'echo $A'")
- test("BONJOURJESUIS=a bash -c 'echo $BONJOURJESUIS'")
- test("bonjourjesuis=a bash -c 'echo $bonjourjesuis'")
- test("bonjour_je_suis=a bash -c 'echo $bonjour_je_suis'")
- test("BONJOURJESUIS1=a bash -c 'echo $BONJOURJESUIS1'")
- test("bO_nJq123o__1ju_je3234sui__a=a bash -c 'echo $bO_nJq123o__1ju_je3234sui__a'")
- test("a0123456789=a bash -c 'echo $a0123456789")
- test("abcdefghijklmnopqrstuvwxyz=a bash -c 'echo $abcdefghijklmnopqrstuvwxyz'")
- test("ABCDEFGHIJKLMNOPQRSTUVWXYZ=a bash -c 'echo $ABCDEFGHIJKLMNOPQRSTUVWXYZ'")
- test("__________________________=a bash -c 'echo $__________________________'")
- test("_bonjour_=a bash -c 'echo $_bonjour_'")
- test("_=a bash -c 'echo $_a'")
- test("1=a bash -c 'echo $1'")
- test("BONJOURJESUIS =a bash -c 'echo $BONJOURJESUIS '")
- test("BONJOURJESUIS= a bash -c 'echo $BONJOURJESUIS'")
- test(r"BONJOUR\\JESUIS=a bash -c 'echo $BONJOUR\\JESUIS'")
- test(r"BONJOUR\'JESUIS=a bash -c 'echo $BONJOUR\'JESUIS'")
- test(r'BONJOUR\"JESUIS=a bash -c "echo $BONJOUR\"JESUIS"')
- test(r"BONJOUR\$JESUIS=a bash -c 'echo $BONJOUR\$JESUIS'")
- test(r"BONJOUR\&JESUIS=a bash -c 'echo $BONJOUR\&JESUIS'")
- test(r"BONJOUR\|JESUIS=a bash -c 'echo $BONJOUR\|JESUIS'")
- test(r"BONJOUR\;JESUIS=a bash -c 'echo $BONJOUR\;JESUIS'")
- test(r"BONJOUR\_JESUIS=a bash -c 'echo $BONJOUR\_JESUIS'")
- test(r"BONJOUR\0JESUIS=a bash -c 'echo $BONJOUR\0JESUIS'")
- test(r"\B\O\N\ \ \ \ \ \ \ JOURJESUIS=a bash -c 'echo $\B\O\N\ \ \ \ \ \ \ JOURJESUIS'")
- test(r"A=\B\O\N\ \ \ \ \ \ \ JOURJESUIS bash -c 'echo $A'")
- test(r"A='bonjour je suis charles' bash -c 'echo $A'")
- test(r'A="bonjour je suis charles" bash -c "echo $A"')
- test(r"A==a bash -c 'echo $A'")
- test(r"A===a bash -c 'echo $A'")
- test(r"A====a bash -c 'echo $A'")
- test(r"A=====a bash -c 'echo $A'")
- test(r"A======a bash -c 'echo $A'")
- test(r"A=a=a=a=a=a bash -c 'echo $A'")
+ test("A=a sh -c 'echo $A'")
+ test("A=a B=b sh -c 'echo $A$B'")
+ test("A=a B=b C=c D=d E=e F=f G=g H=h sh -c 'echo $A$B$C$D$E$F$G$H'")
+ test("A=a A=bonjour sh -c 'echo $A'")
+ test("A=aA=bonjour sh -c 'echo $A'")
+ test("BONJOURJESUIS=a sh -c 'echo $BONJOURJESUIS'")
+ test("bonjourjesuis=a sh -c 'echo $bonjourjesuis'")
+ test("bonjour_je_suis=a sh -c 'echo $bonjour_je_suis'")
+ test("BONJOURJESUIS1=a sh -c 'echo $BONJOURJESUIS1'")
+ test("bO_nJq123o__1ju_je3234sui__a=a sh -c 'echo $bO_nJq123o__1ju_je3234sui__a'")
+ test("a0123456789=a sh -c 'echo $a0123456789'")
+ test("abcdefghijklmnopqrstuvwxyz=a sh -c 'echo $abcdefghijklmnopqrstuvwxyz'")
+ test("ABCDEFGHIJKLMNOPQRSTUVWXYZ=a sh -c 'echo $ABCDEFGHIJKLMNOPQRSTUVWXYZ'")
+ test("__________________________=a sh -c 'echo $__________________________'")
+ test("_bonjour_=a sh -c 'echo $_bonjour_'")
+ test("_=a sh -c 'echo $_a'")
+ test("1=a")
+ test("BONJOURJESUIS =a sh -c 'echo $BONJOURJESUIS '")
+ test("BONJOURJESUIS= a sh -c 'echo $BONJOURJESUIS'")
+ test(r"BONJOUR\\JESUIS=a sh -c 'echo $BONJOUR\\JESUIS'")
+ test(r'BONJOUR\'JESUIS=a sh -c "echo $BONJOUR\'JESUIS"')
+ test(r'BONJOUR\"JESUIS=a sh -c "echo $BONJOUR\"JESUIS"')
+ test(r"BONJOUR\$JESUIS=a sh -c 'echo $BONJOUR\$JESUIS'")
+ test(r"BONJOUR\&JESUIS=a sh -c 'echo $BONJOUR\&JESUIS'")
+ test(r"BONJOUR\|JESUIS=a sh -c 'echo $BONJOUR\|JESUIS'")
+ test(r"BONJOUR\;JESUIS=a sh -c 'echo $BONJOUR\;JESUIS'")
+ test(r"BONJOUR\_JESUIS=a sh -c 'echo $BONJOUR\_JESUIS'")
+ test(r"BONJOUR\0JESUIS=a sh -c 'echo $BONJOUR\0JESUIS'")
+ test(r"\B\O\N\ \ \ \ \ \ \ JOURJESUIS=a sh -c 'echo $\B\O\N\ \ \ \ \ \ \ JOURJESUIS'")
+ test(r"A=\B\O\N\ \ \ \ \ \ \ JOURJESUIS sh -c 'echo $A'")
+ test(r"A='bonjour je suis charles' sh -c 'echo $A'")
+ test(r'A="bonjour je suis charles" sh -c "echo $A"')
+ test(r"A==a sh -c 'echo $A'")
+ test(r"A===a sh -c 'echo $A'")
+ test(r"A====a sh -c 'echo $A'")
+ test(r"A=====a sh -c 'echo $A'")
+ test(r"A======a sh -c 'echo $A'")
+ test(r"A=a=a=a=a=a sh -c 'echo $A'")
test("A=a; echo $A")
test("A=a B=b; echo $A$B")
@@ -164,7 +164,6 @@ def suite_cmd_variable(test):
test("__________________________=a; echo $__________________________")
test("_bonjour_=a; echo $_bonjour_")
test("_=a; echo $_a")
- test("1=a; echo $1")
test("BONJOURJESUIS =a; echo $BONJOURJESUIS ")
test("BONJOURJESUIS= a; echo $BONJOURJESUIS")
test(r"BONJOUR\\JESUIS=a; echo $BONJOUR\\JESUIS")
@@ -192,10 +191,12 @@ def suite_cmd_variable(test):
test("A=a echo $A")
test("A=a B=b echo $A$B")
test("A=a B=b C=c D=d E=e F=f G=g H=h echo $A$B$C$D$E$F$G$H")
- test("A=$PATH bash -c 'echo $A'")
- test("A=\"$PATH je suis\" bash -c 'echo $A'")
- test("A='$PATH je suis' bash -c 'echo $A'")
- test("$TEST bash -c 'echo $A'", setup="export TEST='A=a'")
+ test("A=$PATH sh -c 'echo $A'")
+ test("A=\"$PATH je suis\" sh -c 'echo $A'")
+ test("A='$PATH je suis' sh -c 'echo $A'")
+ test("$TEST sh -c 'echo $A'", setup="export TEST='A=a'")
+ test("'BONJOURJESUIS''=''a' sh -c 'echo $BONJOURJESUIS'")
+ test('"BONJOURJESUIS""=""a" sh -c "echo $BONJOURJESUIS"')
@suite
def suite_cmd_path(test):