summaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-misc/assignment2.right2
-rwxr-xr-xshell/ash_test/ash-misc/assignment2.tests3
-rw-r--r--shell/ash_test/ash-misc/empty_args.right6
-rwxr-xr-xshell/ash_test/ash-misc/empty_args.tests9
-rw-r--r--shell/ash_test/ash-misc/env_and_func.right2
-rwxr-xr-xshell/ash_test/ash-misc/env_and_func.tests8
6 files changed, 30 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/assignment2.right b/shell/ash_test/ash-misc/assignment2.right
new file mode 100644
index 0000000..179c71c
--- /dev/null
+++ b/shell/ash_test/ash-misc/assignment2.right
@@ -0,0 +1,2 @@
+./assignment2.tests: line 2: a=b: not found
+127
diff --git a/shell/ash_test/ash-misc/assignment2.tests b/shell/ash_test/ash-misc/assignment2.tests
new file mode 100755
index 0000000..f693843
--- /dev/null
+++ b/shell/ash_test/ash-misc/assignment2.tests
@@ -0,0 +1,3 @@
+# This must not be interpreted as an assignment
+a''=b true
+echo $?
diff --git a/shell/ash_test/ash-misc/empty_args.right b/shell/ash_test/ash-misc/empty_args.right
new file mode 100644
index 0000000..968b5a4
--- /dev/null
+++ b/shell/ash_test/ash-misc/empty_args.right
@@ -0,0 +1,6 @@
+Null 0th arg:
+./empty_args.tests: line 2: : Permission denied
+127
+Null 1st arg:
+0
+Null arg in exec:
diff --git a/shell/ash_test/ash-misc/empty_args.tests b/shell/ash_test/ash-misc/empty_args.tests
new file mode 100755
index 0000000..efce549
--- /dev/null
+++ b/shell/ash_test/ash-misc/empty_args.tests
@@ -0,0 +1,9 @@
+echo Null 0th arg:
+""
+echo $?
+echo Null 1st arg:
+# printf without args would print usage info
+printf ""
+echo $?
+echo Null arg in exec:
+exec printf ""
diff --git a/shell/ash_test/ash-misc/env_and_func.right b/shell/ash_test/ash-misc/env_and_func.right
new file mode 100644
index 0000000..5fc3488
--- /dev/null
+++ b/shell/ash_test/ash-misc/env_and_func.right
@@ -0,0 +1,2 @@
+var=val
+var=val
diff --git a/shell/ash_test/ash-misc/env_and_func.tests b/shell/ash_test/ash-misc/env_and_func.tests
new file mode 100755
index 0000000..3efef1a
--- /dev/null
+++ b/shell/ash_test/ash-misc/env_and_func.tests
@@ -0,0 +1,8 @@
+var=old
+f() { echo "var=$var"; }
+# bash: POSIXLY_CORRECT behavior is to "leak" new variable values
+# out of function invocations (similar to "special builtins" behavior);
+# but in "bash mode", they don't leak.
+# hush does not "leak" values. ash does.
+var=val f
+echo "var=$var"