From 995db702075031dab2876c94a1c948efef1911f7 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 28 Nov 2020 06:11:09 +0100 Subject: Added test for $_ #7 --- src/suites/misc.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/suites/misc.py b/src/suites/misc.py index 004ebf1..a6b9bf2 100644 --- a/src/suites/misc.py +++ b/src/suites/misc.py @@ -6,7 +6,7 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/10/10 13:06:19 by cacharle #+# #+# # -# Updated: 2020/10/24 13:39:48 by charles ### ########.fr # +# Updated: 2020/11/28 06:10:12 by charles ### ########.fr # # # # ############################################################################ # @@ -83,3 +83,18 @@ def suite_shlvl(test): test("echo $SHLVL", exports={"SHLVL": " 00000000000000000000000000000000000000000000001"}) test("echo $SHLVL", exports={"SHLVL": " 00000000000000000000000000000000000000000000000" "00000000000000000000000000000000000000000000001"}) + + +@suite() +def suite_lastcmd(test): + """ test for $_, the last executed command """ + test("echo $_") + test("echo; echo $_") + test("env; echo $_") + test("export A=a; echo $_") + test("unset A; echo $_") + test("echo a b c d; echo $_") + test("cat -e /etc/shells; echo $_") + test("echo a; echo \"$_\"") + test("echo a; echo '$_'") + test("echo a; echo \"@$_@\"") -- cgit