diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-25 22:03:16 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-25 22:03:16 +0200 |
commit | 05c5d745f7b14e265144489b7809a3d6dbbadec6 (patch) | |
tree | 2c845850220a961dfb03d36185f0a1f8ec03fddb | |
parent | 53d45c934f54b7931cc736eba42903cb1f6d4632 (diff) | |
download | busybox-w32-05c5d745f7b14e265144489b7809a3d6dbbadec6.tar.gz busybox-w32-05c5d745f7b14e265144489b7809a3d6dbbadec6.tar.bz2 busybox-w32-05c5d745f7b14e265144489b7809a3d6dbbadec6.zip |
ahell: update testsuite
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash_test/ash-vars/var6.right | 2 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var6.tests | 5 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var_nested1.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_nested1.tests | 16 | ||||
-rw-r--r-- | shell/ash_test/ash-vars/var_nested2.right | 1 | ||||
-rwxr-xr-x | shell/ash_test/ash-vars/var_nested2.tests | 2 | ||||
-rwxr-xr-x | shell/hush_test/hush-vars/var6.tests | 7 |
7 files changed, 33 insertions, 3 deletions
diff --git a/shell/ash_test/ash-vars/var6.right b/shell/ash_test/ash-vars/var6.right new file mode 100644 index 000000000..b37417fa1 --- /dev/null +++ b/shell/ash_test/ash-vars/var6.right | |||
@@ -0,0 +1,2 @@ | |||
1 | SHELL: line 1: syntax error: bad substitution | ||
2 | SHELL: line 1: syntax error: bad substitution | ||
diff --git a/shell/ash_test/ash-vars/var6.tests b/shell/ash_test/ash-vars/var6.tests new file mode 100755 index 000000000..626e60ee1 --- /dev/null +++ b/shell/ash_test/ash-vars/var6.tests | |||
@@ -0,0 +1,5 @@ | |||
1 | # reject invalid vars | ||
2 | # (set argv0 to "SHELL" to avoid "/path/to/shell: blah" in error messages) | ||
3 | "$THIS_SH" -c 'echo ${1q}' SHELL | ||
4 | "$THIS_SH" -c 'echo ${&}' SHELL | ||
5 | #"$THIS_SH" -c 'echo ${$}' SHELL -- this is valid as it's the same as $$ | ||
diff --git a/shell/ash_test/ash-vars/var_nested1.right b/shell/ash_test/ash-vars/var_nested1.right new file mode 100644 index 000000000..f4bc5f4b6 --- /dev/null +++ b/shell/ash_test/ash-vars/var_nested1.right | |||
@@ -0,0 +1,3 @@ | |||
1 | Expected:AB Actual:AB | ||
2 | Expected:Ab Actual:Ab | ||
3 | Expected:ab Actual:ab | ||
diff --git a/shell/ash_test/ash-vars/var_nested1.tests b/shell/ash_test/ash-vars/var_nested1.tests new file mode 100755 index 000000000..59e4a14fa --- /dev/null +++ b/shell/ash_test/ash-vars/var_nested1.tests | |||
@@ -0,0 +1,16 @@ | |||
1 | f() { a=A; b=B; } | ||
2 | |||
3 | a=a | ||
4 | b=b | ||
5 | f | ||
6 | echo Expected:AB Actual:$a$b | ||
7 | |||
8 | a=a | ||
9 | b=b | ||
10 | b= f | ||
11 | echo Expected:Ab Actual:$a$b | ||
12 | |||
13 | a=a | ||
14 | b=b | ||
15 | a= b= f | ||
16 | echo Expected:ab Actual:$a$b | ||
diff --git a/shell/ash_test/ash-vars/var_nested2.right b/shell/ash_test/ash-vars/var_nested2.right new file mode 100644 index 000000000..c930d971c --- /dev/null +++ b/shell/ash_test/ash-vars/var_nested2.right | |||
@@ -0,0 +1 @@ | |||
aB | |||
diff --git a/shell/ash_test/ash-vars/var_nested2.tests b/shell/ash_test/ash-vars/var_nested2.tests new file mode 100755 index 000000000..e8865861e --- /dev/null +++ b/shell/ash_test/ash-vars/var_nested2.tests | |||
@@ -0,0 +1,2 @@ | |||
1 | # the bug was easier to trigger in one-liner form | ||
2 | a=a; b=b; f() { a=A; b=B; }; a= f; echo $a$b | ||
diff --git a/shell/hush_test/hush-vars/var6.tests b/shell/hush_test/hush-vars/var6.tests index aea36d62d..626e60ee1 100755 --- a/shell/hush_test/hush-vars/var6.tests +++ b/shell/hush_test/hush-vars/var6.tests | |||
@@ -1,4 +1,5 @@ | |||
1 | # reject invalid vars | 1 | # reject invalid vars |
2 | "$THIS_SH" -c 'echo ${1q}' | 2 | # (set argv0 to "SHELL" to avoid "/path/to/shell: blah" in error messages) |
3 | "$THIS_SH" -c 'echo ${&}' | 3 | "$THIS_SH" -c 'echo ${1q}' SHELL |
4 | #"$THIS_SH" -c 'echo ${$}' -- this is valid as it's the same as $$ | 4 | "$THIS_SH" -c 'echo ${&}' SHELL |
5 | #"$THIS_SH" -c 'echo ${$}' SHELL -- this is valid as it's the same as $$ | ||