ash: add testsuite entry for POSIX-mandated ${var#word} ${var##word}
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 12 Apr 2008 22:55:33 +0000 (22:55 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 12 Apr 2008 22:55:33 +0000 (22:55 -0000)
${var%word} ${var%%word}

shell/ash_test/ash-vars/var_posix1.right [new file with mode: 0644]
shell/ash_test/ash-vars/var_posix1.tests [new file with mode: 0755]

diff --git a/shell/ash_test/ash-vars/var_posix1.right b/shell/ash_test/ash-vars/var_posix1.right
new file mode 100644 (file)
index 0000000..013b223
--- /dev/null
@@ -0,0 +1,10 @@
+abcdcd
+abcdcd
+abcdcd
+cdcd
+babcdcd
+ababcd
+ababcd
+ababcd
+abab
+ababcdc
diff --git a/shell/ash_test/ash-vars/var_posix1.tests b/shell/ash_test/ash-vars/var_posix1.tests
new file mode 100755 (executable)
index 0000000..a7c85cb
--- /dev/null
@@ -0,0 +1,13 @@
+var=ababcdcd
+
+echo ${var#ab}
+echo ${var#a*b}
+echo ${var##ab}
+echo ${var##a*b}
+echo ${var#?}
+
+echo ${var%cd}
+echo ${var%c*d}
+echo ${var%%cd}
+echo ${var%%c*d}
+echo ${var%?}