summaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-14 06:04:59 +0000
committerDenis Vlasenko2008-06-14 06:04:59 +0000
commit2659c63213fa3592aa1ef5eca356c7332bbb7f42 (patch)
tree5dad6f9a3c219cfccfa5adf4ff5c59728d303fd1 /shell/ash_test
parenta1767a1f5d744804958b2ef0516cbd5d33292c0c (diff)
downloadbusybox-2659c63213fa3592aa1ef5eca356c7332bbb7f42.zip
busybox-2659c63213fa3592aa1ef5eca356c7332bbb7f42.tar.gz
ash: fix ${var/s/r} handling, add testcase.
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-vars/var_bash3.right20
-rwxr-xr-xshell/ash_test/ash-vars/var_bash3.tests41
2 files changed, 61 insertions, 0 deletions
diff --git a/shell/ash_test/ash-vars/var_bash3.right b/shell/ash_test/ash-vars/var_bash3.right
new file mode 100644
index 0000000..f7f1479
--- /dev/null
+++ b/shell/ash_test/ash-vars/var_bash3.right
@@ -0,0 +1,20 @@
+a041#c
+a041#c
+a\041#c
+a\041#c
+a\041#c
+a\041#c
+a\041#c
+a\041#c
+a\041#c
+a\c
+a\c
+a\c
+a\\c
+a\\c
+a\\c
+a\tc
+a\tc
+a\tc
+atc
+a\tc
diff --git a/shell/ash_test/ash-vars/var_bash3.tests b/shell/ash_test/ash-vars/var_bash3.tests
new file mode 100755
index 0000000..b905027
--- /dev/null
+++ b/shell/ash_test/ash-vars/var_bash3.tests
@@ -0,0 +1,41 @@
+a='abc'
+r=${a//b/\041#}
+echo $r
+echo ${a//b/\041#}
+echo "${a//b/\041#}"
+
+a='abc'
+r=${a//b/\\041#}
+echo $r
+echo ${a//b/\\041#}
+echo "${a//b/\\041#}"
+
+a='abc'
+b='\041#'
+r=${a//b/$b}
+echo $r
+echo ${a//b/$b}
+echo "${a//b/$b}"
+
+a='abc'
+b='\'
+r="${a//b/$b}"
+echo $r
+echo ${a//b/$b}
+echo "${a//b/$b}"
+
+a='abc'
+b='\\'
+r="${a//b/$b}"
+echo $r
+echo ${a//b/$b}
+echo "${a//b/$b}"
+
+a='abc'
+b='\t'
+r="${a//b/$b}"
+echo $r
+echo ${a//b/$b}
+echo "${a//b/$b}"
+echo ${a//b/\t}
+echo "${a//b/\t}"