aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-08-05 17:19:27 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-05 17:19:27 +0200
commitb0fbe4b5409b136e0c80788cf183ec24237e9c97 (patch)
treed5ef2215b48c894721801f0fe7184a347f91d669 /shell/ash_test
parente74d79866c6d125527e3ba69245a087a28fd19ce (diff)
downloadbusybox-w32-b0fbe4b5409b136e0c80788cf183ec24237e9c97.tar.gz
busybox-w32-b0fbe4b5409b136e0c80788cf183ec24237e9c97.tar.bz2
busybox-w32-b0fbe4b5409b136e0c80788cf183ec24237e9c97.zip
ash: add a testcase for bug 2281 (currently fails). Small code cleanups.
function old new delta changepath 195 192 -3 subevalvar 1204 1200 -4 readtoken1 3247 3240 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-14) Total: -14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
-rwxr-xr-x[-rw-r--r--]shell/ash_test/ash-redir/redir9.tests0
-rw-r--r--shell/ash_test/ash-vars/var_bash3.right40
-rwxr-xr-xshell/ash_test/ash-vars/var_bash3.tests47
-rw-r--r--shell/ash_test/ash-vars/var_bash4.right2
-rwxr-xr-xshell/ash_test/ash-vars/var_bash4.tests3
5 files changed, 52 insertions, 40 deletions
diff --git a/shell/ash_test/ash-redir/redir9.tests b/shell/ash_test/ash-redir/redir9.tests
index 8befa611c..8befa611c 100644..100755
--- a/shell/ash_test/ash-redir/redir9.tests
+++ b/shell/ash_test/ash-redir/redir9.tests
diff --git a/shell/ash_test/ash-vars/var_bash3.right b/shell/ash_test/ash-vars/var_bash3.right
index f7f14791e..a97c850ea 100644
--- a/shell/ash_test/ash-vars/var_bash3.right
+++ b/shell/ash_test/ash-vars/var_bash3.right
@@ -1,20 +1,20 @@
1a041#c 11 a041#c
2a041#c 22 a041#c
3a\041#c 33 a\041#c
4a\041#c 44 a\041#c
5a\041#c 55 a\041#c
6a\041#c 66 a\041#c
7a\041#c 77 a\041#c
8a\041#c 88 a\041#c
9a\041#c 99 a\041#c
10a\c 1010 a\c
11a\c 1111 a\c
12a\c 1212 a\c
13a\\c 1313 a\\c
14a\\c 1414 a\\c
15a\\c 1515 a\\c
16a\tc 1616 a\tc
17a\tc 1717 a\tc
18a\tc 1818 a\tc
19atc 1919 atc
20a\tc 2020 a\tc
diff --git a/shell/ash_test/ash-vars/var_bash3.tests b/shell/ash_test/ash-vars/var_bash3.tests
index b9050279e..eca3318e2 100755
--- a/shell/ash_test/ash-vars/var_bash3.tests
+++ b/shell/ash_test/ash-vars/var_bash3.tests
@@ -1,41 +1,48 @@
1a='abc' 1a='abc'
2r=${a//b/\041#} 2r=${a//b/\041#}
3echo $r 3echo 1 $r
4echo ${a//b/\041#} 4echo 2 ${a//b/\041#}
5echo "${a//b/\041#}" 5echo 3 "${a//b/\041#}"
6# --- var_bash3.xx
7# +++ var_bash3.right
8# -1 a\041#c
9# +1 a041#c
10# 2 a041#c
11# -3 a041#c
12# +3 a\041#c
6 13
7a='abc' 14a='abc'
8r=${a//b/\\041#} 15r=${a//b/\\041#}
9echo $r 16echo 4 $r
10echo ${a//b/\\041#} 17echo 5 ${a//b/\\041#}
11echo "${a//b/\\041#}" 18echo 6 "${a//b/\\041#}"
12 19
13a='abc' 20a='abc'
14b='\041#' 21b='\041#'
15r=${a//b/$b} 22r=${a//b/$b}
16echo $r 23echo 7 $r
17echo ${a//b/$b} 24echo 8 ${a//b/$b}
18echo "${a//b/$b}" 25echo 9 "${a//b/$b}"
19 26
20a='abc' 27a='abc'
21b='\' 28b='\'
22r="${a//b/$b}" 29r="${a//b/$b}"
23echo $r 30echo 10 $r
24echo ${a//b/$b} 31echo 11 ${a//b/$b}
25echo "${a//b/$b}" 32echo 12 "${a//b/$b}"
26 33
27a='abc' 34a='abc'
28b='\\' 35b='\\'
29r="${a//b/$b}" 36r="${a//b/$b}"
30echo $r 37echo 13 $r
31echo ${a//b/$b} 38echo 14 ${a//b/$b}
32echo "${a//b/$b}" 39echo 15 "${a//b/$b}"
33 40
34a='abc' 41a='abc'
35b='\t' 42b='\t'
36r="${a//b/$b}" 43r="${a//b/$b}"
37echo $r 44echo 16 $r
38echo ${a//b/$b} 45echo 17 ${a//b/$b}
39echo "${a//b/$b}" 46echo 18 "${a//b/$b}"
40echo ${a//b/\t} 47echo 19 ${a//b/\t}
41echo "${a//b/\t}" 48echo 20 "${a//b/\t}"
diff --git a/shell/ash_test/ash-vars/var_bash4.right b/shell/ash_test/ash-vars/var_bash4.right
new file mode 100644
index 000000000..33a511238
--- /dev/null
+++ b/shell/ash_test/ash-vars/var_bash4.right
@@ -0,0 +1,2 @@
1a*b-backslashstar-
2Done: 0
diff --git a/shell/ash_test/ash-vars/var_bash4.tests b/shell/ash_test/ash-vars/var_bash4.tests
new file mode 100755
index 000000000..304b3d91c
--- /dev/null
+++ b/shell/ash_test/ash-vars/var_bash4.tests
@@ -0,0 +1,3 @@
1FOO='a*b\*c'
2echo "${FOO//\\*/-backslashstar-}"
3echo Done: $?