aboutsummaryrefslogtreecommitdiff
path: root/minishell_test/suites/misc.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-05 12:27:32 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-05 12:27:32 +0100
commit904a033ae738e1c351f8fef71e2ec2418fc4db3d (patch)
tree3de4980582c109c4f0d19111a2b88eafec9b9b36 /minishell_test/suites/misc.py
parenta3e983f78dc4cbcf6f75f78fa2b3c57e09cd1b2b (diff)
downloadminishell_test-904a033ae738e1c351f8fef71e2ec2418fc4db3d.tar.gz
minishell_test-904a033ae738e1c351f8fef71e2ec2418fc4db3d.tar.bz2
minishell_test-904a033ae738e1c351f8fef71e2ec2418fc4db3d.zip
Renaming src -> minishell_test for package name, Renaming main.py -> __main__.py for package execution with python -m
Diffstat (limited to 'minishell_test/suites/misc.py')
-rw-r--r--minishell_test/suites/misc.py100
1 files changed, 100 insertions, 0 deletions
diff --git a/minishell_test/suites/misc.py b/minishell_test/suites/misc.py
new file mode 100644
index 0000000..a6b9bf2
--- /dev/null
+++ b/minishell_test/suites/misc.py
@@ -0,0 +1,100 @@
+# ############################################################################ #
+# #
+# ::: :::::::: #
+# misc.py :+: :+: :+: #
+# +:+ +:+ +:+ #
+# By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ #
+# +#+#+#+#+#+ +#+ #
+# Created: 2020/10/10 13:06:19 by cacharle #+# #+# #
+# Updated: 2020/11/28 06:10:12 by charles ### ########.fr #
+# #
+# ############################################################################ #
+
+from suite import suite
+
+
+@suite()
+def suite_shlvl(test):
+ """ test for the SHLVL variable """
+ test("echo $SHLVL")
+ test("echo $SHLVL", exports={"SHLVL": ""})
+ test("echo $SHLVL", exports={"SHLVL": " 1"})
+ test("echo $SHLVL", exports={"SHLVL": " 2"})
+ test("echo $SHLVL", exports={"SHLVL": " 3"})
+ test("echo $SHLVL", exports={"SHLVL": " ' 3'"})
+ test("echo $SHLVL", exports={"SHLVL": " '\t3'"})
+ test("echo $SHLVL", exports={"SHLVL": " '\t\f\r 3'"})
+ test("echo $SHLVL", exports={"SHLVL": " '3 '"})
+ test("echo $SHLVL", exports={"SHLVL": " '3\t'"})
+ test("echo $SHLVL", exports={"SHLVL": " '3\r'"})
+ test("echo $SHLVL", exports={"SHLVL": " '3\t\f\r '"})
+ test("echo $SHLVL", exports={"SHLVL": " '3 a'"})
+ test("echo $SHLVL", exports={"SHLVL": " '3\t\t\ta'"})
+ test("echo $SHLVL", exports={"SHLVL": " 0"})
+ test("echo $SHLVL", exports={"SHLVL": " -0"})
+ test("echo $SHLVL", exports={"SHLVL": " -1"})
+ test("echo $SHLVL", exports={"SHLVL": " 255"})
+ test("echo $SHLVL", exports={"SHLVL": " 256"})
+ test("echo $SHLVL", exports={"SHLVL": " 2000000"})
+ test("echo $SHLVL", exports={"SHLVL": " -2000000"})
+ test("echo $SHLVL", exports={"SHLVL": " 2147483647"})
+ test("echo $SHLVL", exports={"SHLVL": " -2147483648"})
+ test("echo $SHLVL", exports={"SHLVL": " 2147483648"})
+ test("echo $SHLVL", exports={"SHLVL": " -2147483649"})
+ test("echo $SHLVL", exports={"SHLVL": " 3147483648"})
+ test("echo $SHLVL", exports={"SHLVL": " -3147483649"})
+ test("echo $SHLVL", exports={"SHLVL": " 4294967295"})
+ test("echo $SHLVL", exports={"SHLVL": " 4294967296"})
+ test("echo $SHLVL", exports={"SHLVL": " -9223372036854775808"})
+ test("echo $SHLVL", exports={"SHLVL": " 9223372036854775807"})
+ test("echo $SHLVL", exports={"SHLVL": " -9223372036854775809"})
+ test("echo $SHLVL", exports={"SHLVL": " 9223372036854775808"})
+ test("echo $SHLVL", exports={"SHLVL": " 18446744073709551615"})
+ test("echo $SHLVL", exports={"SHLVL": " 18446744073709551616"})
+ test("echo $SHLVL", exports={"SHLVL": " +1"})
+ test("echo $SHLVL", exports={"SHLVL": " +2"})
+ test("echo $SHLVL", exports={"SHLVL": " +3"})
+ test("echo $SHLVL", exports={"SHLVL": " +0"})
+ test("echo $SHLVL", exports={"SHLVL": " +255"})
+ test("echo $SHLVL", exports={"SHLVL": " +256"})
+ test("echo $SHLVL", exports={"SHLVL": " +2000000"})
+ test("echo $SHLVL", exports={"SHLVL": " +2147483647"})
+ test("echo $SHLVL", exports={"SHLVL": " ++1"})
+ test("echo $SHLVL", exports={"SHLVL": " ++2"})
+ test("echo $SHLVL", exports={"SHLVL": " ++3"})
+ test("echo $SHLVL", exports={"SHLVL": " ++0"})
+ test("echo $SHLVL", exports={"SHLVL": " ++255"})
+ test("echo $SHLVL", exports={"SHLVL": " ++256"})
+ test("echo $SHLVL", exports={"SHLVL": " ++2000000"})
+ test("echo $SHLVL", exports={"SHLVL": " ++2147483647"})
+ test("echo $SHLVL", exports={"SHLVL": " --1"})
+ test("echo $SHLVL", exports={"SHLVL": " --2"})
+ test("echo $SHLVL", exports={"SHLVL": " --3"})
+ test("echo $SHLVL", exports={"SHLVL": " --0"})
+ test("echo $SHLVL", exports={"SHLVL": " --255"})
+ test("echo $SHLVL", exports={"SHLVL": " --256"})
+ test("echo $SHLVL", exports={"SHLVL": " --2000000"})
+ test("echo $SHLVL", exports={"SHLVL": " --2147483647"})
+ test("echo $SHLVL", exports={"SHLVL": " bonjour"})
+ test("echo $SHLVL", exports={"SHLVL": " 0_"})
+ test("echo $SHLVL", exports={"SHLVL": " _0"})
+ test("echo $SHLVL", exports={"SHLVL": " 0123456789"})
+ test("echo $SHLVL", exports={"SHLVL": " -0123456789"})
+ 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 \"@$_@\"")