From 4f870496e7d934fcbe092478f1da8ec7a3ea4466 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 10 Sep 2010 11:06:01 +0200 Subject: hush: do fewer strdups in % and hash expansions function old new delta builtin_umask 133 132 -1 expand_one_var 1552 1543 -9 Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-vars/var_bash6.right | 5 +++++ shell/hush_test/hush-vars/var_bash6.tests | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 shell/hush_test/hush-vars/var_bash6.right create mode 100755 shell/hush_test/hush-vars/var_bash6.tests (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-vars/var_bash6.right b/shell/hush_test/hush-vars/var_bash6.right new file mode 100644 index 000000000..63fc23df8 --- /dev/null +++ b/shell/hush_test/hush-vars/var_bash6.right @@ -0,0 +1,5 @@ +Expected Actual +a*z : a*z +\z : \z +a1z a2z: a1z a2z +z : z diff --git a/shell/hush_test/hush-vars/var_bash6.tests b/shell/hush_test/hush-vars/var_bash6.tests new file mode 100755 index 000000000..cf2e4f020 --- /dev/null +++ b/shell/hush_test/hush-vars/var_bash6.tests @@ -0,0 +1,9 @@ +# This testcase checks globbing correctness in ${v/a/b} + +>a1z; >a2z; + echo 'Expected' 'Actual' +v='a bz'; echo 'a*z :' "${v/a*z/a*z}" +v='a bz'; echo '\z :' "${v/a*z/\z}" +v='a bz'; echo 'a1z a2z:' ${v/a*z/a*z} +v='a bz'; echo 'z :' ${v/a*z/\z} +rm a1z a2z -- cgit v1.2.3