From 2ffd95c295b117053f6e5430ba3ccc72beb224aa Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 11 Sep 2020 20:18:37 +0200 Subject: Linting with flake8 --- src/suites/builtin.py | 92 ++++++++++++++++--------------- src/suites/cmd.py | 35 ++++++------ src/suites/operation.py | 26 ++++----- src/suites/parenthesis.py | 14 ++--- src/suites/path.py | 4 +- src/suites/preprocess.py | 136 +++++++++++++++++++++++----------------------- 6 files changed, 155 insertions(+), 152 deletions(-) (limited to 'src/suites') diff --git a/src/suites/builtin.py b/src/suites/builtin.py index 95e9ed5..06686bb 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/09/11 18:45:03 by charles ### ########.fr # +# Updated: 2020/09/11 19:56:44 by charles ### ########.fr # # Updated: 2020/09/11 18:01:27 by juligonz ### ########.fr # # # # **************************************************************************** # @@ -17,6 +17,7 @@ import config import hooks from suite import suite + @suite() def suite_echo(test): test("echo") @@ -39,6 +40,7 @@ def suite_echo(test): test('echo -n a "" b "" c "" d') test("echo '' '' ''") + @suite() def suite_export(test): test("export", hook=hooks.export_singleton) @@ -49,9 +51,9 @@ def suite_export(test): test("export", exports={"A": "a"}, hook=hooks.export_singleton) test("export A=a; echo $A") test("export A=a B=b C=c; echo $A$B$C") - test("export A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j K=k L=l" + - "M=m N=n O=o P=p Q=q R=r S=s T=t U=u V=v W=w X=x Y=y Z=z" + - "; echo $A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z") + test("export A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j K=k L=l" + "M=m N=n O=o P=p Q=q R=r S=s T=t U=u V=v W=w X=x Y=y Z=z" + "; echo $A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z") test("export BONJOURJESUIS=a; echo $BONJOURJESUIS") test("export bonjourjesuis=a; echo $bonjourjesuis") test("export bonjour_je_suis=a; echo $bonjour_je_suis") @@ -112,32 +114,32 @@ def suite_export(test): @suite() def suite_cd(test): - test("cd .; pwd; echo $PWD"); - test("cd ..; pwd; echo $PWD"); - test("cd ../..; pwd; echo $PWD"); - test("cd ../../..; pwd; echo $PWD"); - test("cd ../../../..; pwd; echo $PWD"); - test("cd ../../../../..; pwd; echo $PWD"); - test("cd ../../../../../..; pwd; echo $PWD"); - test("cd /; pwd; echo $PWD"); - test("cd /etc; pwd; echo $PWD"); - test("cd ''; pwd; echo $PWD"); - test("cd '' ''; pwd; echo $PWD"); - test("cd '' '' ''; pwd; echo $PWD"); - test("cd ' '; pwd; echo $PWD"); + test("cd .; pwd; echo $PWD") + test("cd ..; pwd; echo $PWD") + test("cd ../..; pwd; echo $PWD") + test("cd ../../..; pwd; echo $PWD") + test("cd ../../../..; pwd; echo $PWD") + test("cd ../../../../..; pwd; echo $PWD") + test("cd ../../../../../..; pwd; echo $PWD") + test("cd /; pwd; echo $PWD") + test("cd /etc; pwd; echo $PWD") + test("cd ''; pwd; echo $PWD") + test("cd '' ''; pwd; echo $PWD") + test("cd '' '' ''; pwd; echo $PWD") + test("cd ' '; pwd; echo $PWD") test("cd d ''; pwd; echo $PWD", setup="mkdir d") test("cd d d; pwd; echo $PWD", setup="mkdir d") test("cd d ' '; pwd; echo $PWD", setup="mkdir d") - test("cd $HOME; pwd; echo $PWD"); - test("cd $HOME; pwd; echo $PWD", exports={"HOME": os.getenv("HOME")}); - test("cd /; pwd; echo $PWD"); - test("cd /.; pwd; echo $PWD"); - test("cd /./; pwd; echo $PWD"); - test("cd /././././; pwd; echo $PWD"); - test("cd //; pwd; echo $PWD"); - test("cd ///; pwd; echo $PWD"); - test("cd ////; pwd; echo $PWD"); - test("cd //////////////////////////////////////////////////////; pwd; echo $PWD"); + test("cd $HOME; pwd; echo $PWD") + test("cd $HOME; pwd; echo $PWD", exports={"HOME": os.getenv("HOME")}) + test("cd /; pwd; echo $PWD") + test("cd /.; pwd; echo $PWD") + test("cd /./; pwd; echo $PWD") + test("cd /././././; pwd; echo $PWD") + test("cd //; pwd; echo $PWD") + test("cd ///; pwd; echo $PWD") + test("cd ////; pwd; echo $PWD") + test("cd //////////////////////////////////////////////////////; pwd; echo $PWD") test("cd") test("cd ' /'; pwd; echo $PWD") test("cd ' / '; pwd; echo $PWD") @@ -206,22 +208,21 @@ def suite_unset(test): test("unset 'A='; echo $A", exports={"A": "a"}) test("unset A B C; echo $A$B$C", exports={"A": "a", "B": "b", "C": "c"}) test("unset A 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf ' C; echo $A$B$C", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf ' C; echo $A$B$C", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset A 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf '; echo $A$B$C", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset A; echo $A$B$C", exports={"A": "a", "B": "b", "C": "c"}) test("unset C; echo $A$B$C", exports={"A": "a", "B": "b", "C": "c"}) test("unset A B C", exports={"A": "a", "B": "b", "C": "c"}) test("unset A 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf ' C", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf ' C", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset A 'asdf ' B ' asdf asdf asd f' ' asdf ' '' 'asdf '", - exports={"A": "a", "B": "b", "C": "c"}) + exports={"A": "a", "B": "b", "C": "c"}) test("unset A", exports={"A": "a", "B": "b", "C": "c"}) - test("unset 'AH@'=nop") test("unset \"AH'\"=nop") test("unset 'AH\"'=nop") @@ -232,6 +233,7 @@ def suite_unset(test): test("unset 'AH&'=nop") test("unset 'AH\\'=nop") + @suite() def suite_pwd(test): test("pwd") @@ -243,6 +245,7 @@ def suite_pwd(test): test("pwd | cat -e") # test("cd lnk; rmdir ../d; pwd", setup="mkdir d; ln -s d lnk") + @suite() def suite_env(test): test("env", hook=hooks.sort_lines) @@ -250,6 +253,7 @@ def suite_env(test): test("env", setup="export A=a B=b C=c", hook=hooks.sort_lines) test("env | cat -e", setup="export A=a B=b C=c", hook=hooks.sort_lines) + @suite() def suite_exit(test): test("exit") @@ -316,16 +320,16 @@ def suite_exit(test): test("exit 0123456789") test("exit -0123456789") test("exit 00000000000000000000000000000000000000000000001") - test("exit 00000000000000000000000000000000000000000000000" + - "00000000000000000000000000000000000000000000001") - test("exit 00000000000000000000000000000000000000000000000" + - "00000000000000000000000000000000000000000000000") - test("exit -00000000000000000000000000000000000000000000000" + - "00000000000000000000000000000000000000000000001") - test("exit -99999999999999999999999999999999999999999999" + - "99999999999999999999999999999999999999999999") - test("exit 99999999999999999999999999999999999999999999" + - "99999999999999999999999999999999999999999999") + test("exit 00000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000001") + test("exit 00000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000000") + test("exit -00000000000000000000000000000000000000000000000" + "00000000000000000000000000000000000000000000001") + test("exit -99999999999999999999999999999999999999999999" + "99999999999999999999999999999999999999999999") + test("exit 99999999999999999999999999999999999999999999" + "99999999999999999999999999999999999999999999") test("exit 0 bonjour") test("exit bonjour 0") test("exit 0 1") diff --git a/src/suites/cmd.py b/src/suites/cmd.py index 7294f3a..f258dd4 100644 --- a/src/suites/cmd.py +++ b/src/suites/cmd.py @@ -6,13 +6,12 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 15:11:46 by charles #+# #+# # -# Updated: 2020/09/11 18:29:06 by charles ### ########.fr # +# Updated: 2020/09/11 20:12:16 by charles ### ########.fr # # # # ############################################################################ # import distutils -import config import hooks from suite import suite @@ -60,11 +59,11 @@ def suite_redirection(test): test("echo bonjour>>test>je>>suis", setup="", files=["test", "je", "suis"]) test("cat a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'r's't'u'v'w'x'y'z'", - files=["abcdefghijklmnopqrstuvwxyz"]) + files=["abcdefghijklmnopqrstuvwxyz"]) test('echo bonjour > a"b"c"d"e"f"g"h"i"j"k"l"m"n"o"p"q"r"s"t"u"v"w"x"y"z"', - files=["abcdefghijklmnopqrstuvwxyz"]) + files=["abcdefghijklmnopqrstuvwxyz"]) test('echo bonjour > a\'b\'c"d"e\'f\'g"h"i\'j\'k"l"m\'n\'o"p\'q\'r"s\'t\'u"v"w"x"y\'z\'', - files=["abcdefghijklmnopqrstuvwxyz"]) + files=["abcdefghijklmnopqrstuvwxyz"]) test("> file", files=["file"]) test("< file", setup="echo bonjour > file") test(">", hook=hooks.error_line0) @@ -119,12 +118,12 @@ def suite_cmd_path(test): test("./bonjour", setup="touch a b c; cp {} bonjour".format(ls_path)) test("./bonjour -l", setup="touch a b c; cp {} bonjour".format(ls_path)) test("./somedir/bonjour -l", - setup="mkdir somedir; touch a b c; touch somedir/d somedir/e;" + - "cp {} somedir/bonjour".format(ls_path)) + setup="mkdir somedir; touch a b c; touch somedir/d somedir/e;" + "cp {} somedir/bonjour".format(ls_path)) test("./ls . a b c", - setup="touch a b c; echo bonjour > a; cp {} ls".format(cat_path)) + setup="touch a b c; echo bonjour > a; cp {} ls".format(cat_path)) test("ls . a b c", - setup="touch a b c; echo bonjour > a; cp {} ls".format(cat_path)) + setup="touch a b c; echo bonjour > a; cp {} ls".format(cat_path)) test("./somefile", setup="touch somefile; chmod 000 somefile") test("./somefile", setup="touch somefile; chmod 001 somefile") test("./somefile", setup="touch somefile; chmod 002 somefile") @@ -165,17 +164,17 @@ def suite_cmd_path(test): 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") - test("./somelink3", setup="touch somefile; ln -s somefile somelink1; ln -s somelink1 somelink2;" + - "ln -s somelink2 somelink3") - test("./somelink4", setup="touch somefile; ln -s somefile somelink1; ln -s somelink1 somelink2;" + - "ln -s somelink2 somelink3; ln -s somelink3 somelink4") - test("./somelink2ls", setup="cp " + ls_path + " somefile;" + + test("./somelink3", setup="touch somefile; ln -s somefile somelink1; ln -s somelink1 somelink2;" + "ln -s somelink2 somelink3") + test("./somelink4", setup="touch somefile; ln -s somefile somelink1; ln -s somelink1 somelink2;" + "ln -s somelink2 somelink3; ln -s somelink3 somelink4") + test("./somelink2ls", setup="cp " + ls_path + " somefile;" "ln -s somefile somelink1; ln -s somelink1 somelink2") - test("./somelink3ls", setup="cp " + ls_path + " somefile;" + - "ln -s somefile somelink1; ln -s somelink1 somelink2;" + + test("./somelink3ls", setup="cp " + ls_path + " somefile;" + "ln -s somefile somelink1; ln -s somelink1 somelink2;" "ln -s somelink2 somelink3") - test("./somelink4ls", setup="cp " + ls_path + " somefile;" + - "ln -s somefile somelink1; ln -s somelink1 somelink2;" + + test("./somelink4ls", setup="cp " + ls_path + " somefile;" + "ln -s somefile somelink1; ln -s somelink1 somelink2;" "ln -s somelink2 somelink3; ln -s somelink3 somelink4") test("_", setup="touch _") test("'-'", setup="touch -") diff --git a/src/suites/operation.py b/src/suites/operation.py index 9d9c6d8..18ebd72 100644 --- a/src/suites/operation.py +++ b/src/suites/operation.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:52 by charles #+# #+# # -# Updated: 2020/09/11 17:43:58 by charles ### ########.fr # +# Updated: 2020/09/11 20:12:54 by charles ### ########.fr # # # # ############################################################################ # @@ -26,11 +26,11 @@ def suite_end(test): test("; echo", hook=hooks.error_line0) test(" ;echo", hook=hooks.error_line0) test(" ; echo", hook=hooks.error_line0) - test("echo a; echo b; echo c; echo d; echo e; echo f; echo g; echo h; echo i;" + - "echo j; echo k; echo l; echo m; echo c; echo c; echo c; echo c; echo c;" + + test("echo a; echo b; echo c; echo d; echo e; echo f; echo g; echo h; echo i;" + "echo j; echo k; echo l; echo m; echo c; echo c; echo c; echo c; echo c;" "echo c; echo c; echo c; echo v; echo w; echo x; echo y; echo z") - test("echo a ; echo b; echo c ;echo d ; echo e ;echo f; echo g ;echo h; echo i;" + - "echo j ; echo k; echo l; echo m; echo c ; echo c; echo c ; echo c; echo c;" + + test("echo a ; echo b; echo c ;echo d ; echo e ;echo f; echo g ;echo h; echo i;" + "echo j ; echo k; echo l; echo m; echo c ; echo c; echo c ; echo c; echo c;" "echo c; echo c ; echo c; echo v ; echo w; echo x; echo y ; echo z") test("ls doesnotexists ; echo bonjour") test("ls doesnotexists; echo bonjour") @@ -70,11 +70,11 @@ def suite_and(test): test("&&echo", hook=hooks.error_line0) test("&& echo", hook=hooks.error_line0) test(" && echo", hook=hooks.error_line0) - test("echo a&& echo b&& echo c&& echo d&& echo e&& echo f&& echo g&& echo h&& echo i&&" + - "echo j&& echo k&& echo l&& echo m&& echo c&& echo c&& echo c&& echo c&& echo c&&" + + test("echo a&& echo b&& echo c&& echo d&& echo e&& echo f&& echo g&& echo h&& echo i&&" + "echo j&& echo k&& echo l&& echo m&& echo c&& echo c&& echo c&& echo c&& echo c&&" "echo c&& echo c&& echo c&& echo v&& echo w&& echo x&& echo y&& echo z") - test("echo a && echo b&& echo c &&echo d && echo e &&echo f&& echo g &&echo h&& echo i&&" + - "echo j && echo k&& echo l&& echo m&& echo c && echo c&& echo c && echo c&& echo c&&" + + test("echo a && echo b&& echo c &&echo d && echo e &&echo f&& echo g &&echo h&& echo i&&" + "echo j && echo k&& echo l&& echo m&& echo c && echo c&& echo c && echo c&& echo c&&" "echo c&& echo c && echo c&& echo v && echo w&& echo x&& echo y && echo z") test("ls doesnotexists && echo bonjour") test("ls doesnotexists&& echo bonjour") @@ -93,11 +93,11 @@ def suite_or(test): test("||echo", hook=hooks.error_line0) test("|| echo", hook=hooks.error_line0) test(" || echo", hook=hooks.error_line0) - test("echo a|| echo b|| echo c|| echo d|| echo e|| echo f|| echo g|| echo h|| echo i||" + - "echo j|| echo k|| echo l|| echo m|| echo c|| echo c|| echo c|| echo c|| echo c||" + + test("echo a|| echo b|| echo c|| echo d|| echo e|| echo f|| echo g|| echo h|| echo i||" + "echo j|| echo k|| echo l|| echo m|| echo c|| echo c|| echo c|| echo c|| echo c||" "echo c|| echo c|| echo c|| echo v|| echo w|| echo x|| echo y|| echo z") - test("echo a || echo b|| echo c ||echo d || echo e ||echo f|| echo g ||echo h|| echo i||" + - "echo j || echo k|| echo l|| echo m|| echo c || echo c|| echo c || echo c|| echo c||" + + test("echo a || echo b|| echo c ||echo d || echo e ||echo f|| echo g ||echo h|| echo i||" + "echo j || echo k|| echo l|| echo m|| echo c || echo c|| echo c || echo c|| echo c||" "echo c|| echo c || echo c|| echo v || echo w|| echo x|| echo y || echo z") test("ls doesnotexists || echo bonjour") test("ls doesnotexists|| echo bonjour") diff --git a/src/suites/parenthesis.py b/src/suites/parenthesis.py index d2007cb..6a1e7f1 100644 --- a/src/suites/parenthesis.py +++ b/src/suites/parenthesis.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:24:57 by charles #+# #+# # -# Updated: 2020/09/11 17:43:34 by charles ### ########.fr # +# Updated: 2020/09/11 20:12:27 by charles ### ########.fr # # # # ############################################################################ # @@ -27,23 +27,23 @@ def suite_parenthesis(test): test("(echo bonjour > f1)", files=["f1"]) test("(echo bonjour > f1 > f2 > f3)", files=["f1", "f2", "f3"]) test("(echo bonjour > f1 > f2 > f3 > f4 > f5 > f6 > f7 > f8 > f9)", - files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) + files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) test("(echo bonjour) > f1", files=["f1"]) test("(echo bonjour) > f1 > f2 > f3", files=["f1", "f2", "f3"]) test("(echo bonjour) > f1 > f2 > f3 > f4 > f5 > f6 > f7 > f8 > f9", - files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) + files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) test("(cat -e < f1)", setup="echo bonjour > f1") test("(cat -e < f1 < f2 < f3)", setup="touch f1 f2 f3 f4; echo bonjour > f3") test("(cat -e < f1 < f2 < f3 < f4 < f5 < f6 < f7 < f8 < f9)", - setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9") + setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9") test("(cat -e) < f1", setup="echo bonjour > f1") test("(cat -e) < f1 < f2 < f3", setup="touch f1 f2 f3 f4; echo bonjour > f3") test("(cat -e) < f1 < f2 < f3 < f4 < f5 < f6 < f7 < f8 < f9", - setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9") + setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f9") test("(echo bonjour > f1 > f2 > f3 > f4) > f5 > f6 > f7 > f8 > f9", - files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) + files=["f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9"]) test("(cat -e < f1 < f2 < f3 < f4) < f5 < f6 < f7 < f8 < f9", - setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f4") + setup="touch f1 f2 f3 f4 f5 f6 f7 f8 f9; echo bonjour > f4") test("(echo bonjour > f1) > f2", files=["f1", "f2"]) test("(cat -e > f1) < f2", setup="ls -l / > f2", files=["f1"]) test("(exit); echo bonjour") diff --git a/src/suites/path.py b/src/suites/path.py index bcac98e..0e143dd 100644 --- a/src/suites/path.py +++ b/src/suites/path.py @@ -6,13 +6,13 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/09 15:12:58 by charles #+# #+# # -# Updated: 2020/09/11 17:43:14 by charles ### ########.fr # +# Updated: 2020/09/11 20:13:09 by charles ### ########.fr # # # # ############################################################################ # -import config from suite import suite + @suite() def suite_path(test): test("a", setup="mkdir path && cp /bin/ls ./path/a && chmod 000 ./path/a", exports={"PATH": "path"}) diff --git a/src/suites/preprocess.py b/src/suites/preprocess.py index 6761df9..a407809 100644 --- a/src/suites/preprocess.py +++ b/src/suites/preprocess.py @@ -6,7 +6,7 @@ # By: juligonz +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/07/15 18:25:00 by charles #+# #+# # -# Updated: 2020/09/11 19:37:11 by charles ### ########.fr # +# Updated: 2020/09/11 20:15:08 by charles ### ########.fr # # # # **************************************************************************** # @@ -59,21 +59,21 @@ def suite_quote(test): @suite() def suite_interpolation(test): - test("echo $TEST", exports={"TEST": "bonjour"}) - test("echo $TES", exports={"TEST": "bonjour"}) - test("echo $TEST_", exports={"TEST": "bonjour"}) - test('echo "|$TEST|"', exports={"TEST": "bonjour"}) - test('echo "|$TES|"', exports={"TEST": "bonjour"}) - test('echo "|$TEST_|"', exports={"TEST": "bonjour"}) - test("echo '|$TEST|'", exports={"TEST": "bonjour"}) - test("echo '|$TES|'", exports={"TEST": "bonjour"}) - test("echo '|$TEST_|'", exports={"TEST": "bonjour"}) - test("echo $A$B$C", exports={"A": "foo", "B": "bar", "C": "baz"}) - test('echo "$A$B$C"', exports={"A": "foo", "B": "bar", "C": "baz"}) - test("echo '$A$B$C'", exports={"A": "foo", "B": "bar", "C": "baz"}) - test("echo $A,$B,$C", exports={"A": "foo", "B": "bar", "C": "baz"}) - test('echo "$A,$B,$C"', exports={"A": "foo", "B": "bar", "C": "baz"}) - test("echo '$A,$B,$C'", exports={"A": "foo", "B": "bar", "C": "baz"}) + test("echo $TEST", exports={"TEST": "bonjour"}) + test("echo $TES", exports={"TEST": "bonjour"}) + test("echo $TEST_", exports={"TEST": "bonjour"}) + test('echo "|$TEST|"', exports={"TEST": "bonjour"}) + test('echo "|$TES|"', exports={"TEST": "bonjour"}) + test('echo "|$TEST_|"', exports={"TEST": "bonjour"}) + test("echo '|$TEST|'", exports={"TEST": "bonjour"}) + test("echo '|$TES|'", exports={"TEST": "bonjour"}) + test("echo '|$TEST_|'", exports={"TEST": "bonjour"}) + test("echo $A$B$C", exports={"A": "foo", "B": "bar", "C": "baz"}) + test('echo "$A$B$C"', exports={"A": "foo", "B": "bar", "C": "baz"}) + test("echo '$A$B$C'", exports={"A": "foo", "B": "bar", "C": "baz"}) + test("echo $A,$B,$C", exports={"A": "foo", "B": "bar", "C": "baz"}) + test('echo "$A,$B,$C"', exports={"A": "foo", "B": "bar", "C": "baz"}) + test("echo '$A,$B,$C'", exports={"A": "foo", "B": "bar", "C": "baz"}) test('echo $A"$B"$C"A"$B"$C"', exports={"A": "foo", "B": "bar", "C": "baz"}) test("echo $A'$B'$C'A'$B'$C'", exports={"A": "foo", "B": "bar", "C": "baz"}) test('echo $A"$B"$C"A"$B"$C"', exports={"A": "foo ", "B": " bar ", "C": "baz "}) @@ -96,62 +96,62 @@ def suite_interpolation(test): test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": "bonjour"}) test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": "bonjour je suis"}) test(r"echo \ \ \ \ \ \ \ $A\ \ \ \ \ \ ", exports={"A": " bonjour je suis "}) - test('echo $A', exports={"A": "bonjour je suis splited"}) - test('echo $A', exports={"A": "bonjour je suis splited"}) - test('echo $A', exports={"A": " bonjour je suis splited "}) - test('echo [$A]', exports={"A": "bonjour je suis splited"}) - test('echo [$A]', exports={"A": "bonjour je suis splited"}) - test('echo [$A]', exports={"A": " bonjour je suis splited "}) - test('echo "[$A]"', exports={"A": "bonjour je suis splited"}) - test('echo "[$A]"', exports={"A": "bonjour je suis splited"}) - test('echo "[$A]"', exports={"A": " bonjour je suis splited "}) - test('echo \ $A', exports={"A": "bonjour je suis splited"}) - test('echo \ $A', exports={"A": "bonjour je suis splited"}) - test('echo \ $A', exports={"A": " bonjour je suis splited "}) - test('echo $A\ ', exports={"A": "bonjour je suis splited"}) - test('echo $A\ ', exports={"A": "bonjour je suis splited"}) - test('echo $A\ ', exports={"A": " bonjour je suis splited "}) - test('echo $A$A$A', exports={"A": " bonjour je suis splited "}) - test("echo $A", exports={"A": "'" + config.LOREM + "'"}) - test('echo "$A"', exports={"A": "'" + config.LOREM + "'"}) - test("echo '$A'", exports={"A": "'" + config.LOREM + "'"}) - test("$ECHO $ECHO", exports={"ECHO": "echo"}) + test('echo $A', exports={"A": "bonjour je suis splited"}) + test('echo $A', exports={"A": "bonjour je suis splited"}) + test('echo $A', exports={"A": " bonjour je suis splited "}) + test('echo [$A]', exports={"A": "bonjour je suis splited"}) + test('echo [$A]', exports={"A": "bonjour je suis splited"}) + test('echo [$A]', exports={"A": " bonjour je suis splited "}) + test('echo "[$A]"', exports={"A": "bonjour je suis splited"}) + test('echo "[$A]"', exports={"A": "bonjour je suis splited"}) + test('echo "[$A]"', exports={"A": " bonjour je suis splited "}) + test('echo \\ $A', exports={"A": "bonjour je suis splited"}) + test('echo \\ $A', exports={"A": "bonjour je suis splited"}) + test('echo \\ $A', exports={"A": " bonjour je suis splited "}) + test('echo $A\\ ', exports={"A": "bonjour je suis splited"}) + test('echo $A\\ ', exports={"A": "bonjour je suis splited"}) + test('echo $A\\ ', exports={"A": " bonjour je suis splited "}) + test('echo $A$A$A', exports={"A": " bonjour je suis splited "}) + test("echo $A", exports={"A": "'" + config.LOREM + "'"}) + test('echo "$A"', exports={"A": "'" + config.LOREM + "'"}) + test("echo '$A'", exports={"A": "'" + config.LOREM + "'"}) + test("$ECHO $ECHO", exports={"ECHO": "echo"}) test("$A$B bonjour", exports={"A": "ec", "B": "ho"}) - test("$LS", exports={"LS": "ls -l"}, setup="touch a b c") + test("$LS", exports={"LS": "ls -l"}, setup="touch a b c") test("echo $") - test("echo \$") - test("echo \$\$\$\$") - test("echo \$$\$$") - test("echo $\A $\B", exports={"A": "a", "B": "b"}) - test("echo $\A$\B", exports={"A": "a", "B": "b"}) - test("echo $A", exports={"A": " "}) - test("echo $A", exports={"A": " "}) - test("echo $A", exports={"A": " "}) - test("echo $A", exports={"A": " "}) - test("echo $A", exports={"A": " a "}) - test("echo $A", exports={"A": " "}) - test("echo $A", exports={"A": " a "}) - test("echo @$A@", exports={"A": " "}) - test("echo @ $A@", exports={"A": " "}) - test("echo @$A @", exports={"A": " "}) - test("echo @$A@", exports={"A": " "}) - test("echo '@'$A'@'", exports={"A": " "}) - test("echo '@' $A'@'", exports={"A": " "}) - test("echo '@'$A '@'", exports={"A": " "}) - test('echo "@"$A"@"', exports={"A": " "}) - test('echo "@" $A"@"', exports={"A": " "}) - test('echo "@"$A "@"', exports={"A": " "}) - test('echo @"$A"@', exports={"A": " "}) - test('echo @ "$A"@', exports={"A": " "}) - test('echo @"$A" @', exports={"A": " "}) - test('echo @"$A"@', exports={"A": " "}) - test("echo '@'\"$A\"'@'", exports={"A": " "}) + test("echo \\$") + test("echo \\$\\$\\$\\$") + test("echo \\$$\\$$") + test("echo $\\A $\\B", exports={"A": "a", "B": "b"}) + test("echo $\\A$\\B", exports={"A": "a", "B": "b"}) + test("echo $A", exports={"A": " "}) + test("echo $A", exports={"A": " "}) + test("echo $A", exports={"A": " "}) + test("echo $A", exports={"A": " "}) + test("echo $A", exports={"A": " a "}) + test("echo $A", exports={"A": " "}) + test("echo $A", exports={"A": " a "}) + test("echo @$A@", exports={"A": " "}) + test("echo @ $A@", exports={"A": " "}) + test("echo @$A @", exports={"A": " "}) + test("echo @$A@", exports={"A": " "}) + test("echo '@'$A'@'", exports={"A": " "}) + test("echo '@' $A'@'", exports={"A": " "}) + test("echo '@'$A '@'", exports={"A": " "}) + test('echo "@"$A"@"', exports={"A": " "}) + test('echo "@" $A"@"', exports={"A": " "}) + test('echo "@"$A "@"', exports={"A": " "}) + test('echo @"$A"@', exports={"A": " "}) + test('echo @ "$A"@', exports={"A": " "}) + test('echo @"$A" @', exports={"A": " "}) + test('echo @"$A"@', exports={"A": " "}) + test("echo '@'\"$A\"'@'", exports={"A": " "}) test("echo '@' \"$A\"'@'", exports={"A": " "}) test("echo '@'\"$A\" '@'", exports={"A": " "}) - test('echo "@""$A""@"', exports={"A": " "}) - test('echo "@" "$A""@"', exports={"A": " "}) - test('echo "@""$A" "@"', exports={"A": " "}) - test('echo $A$B$C', exports={"A": "", "B": "", "C": ""}) + test('echo "@""$A""@"', exports={"A": " "}) + test('echo "@" "$A""@"', exports={"A": " "}) + test('echo "@""$A" "@"', exports={"A": " "}) + test('echo $A$B$C', exports={"A": "", "B": "", "C": ""}) @suite() -- cgit