about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2019-12-12 10:22:24 +0000
committerPeter Stephenson <p.stephenson@samsung.com>2019-12-12 10:23:47 +0000
commit273d669a568ed9ee705916e42945f4239501cdcb (patch)
tree7c7a1ac21687dea39d17327ee3d99cddd26fb5c6 /Test
parentc578f0a08b9257f3db85dab5431270f1a6eb8858 (diff)
downloadzsh-273d669a568ed9ee705916e42945f4239501cdcb.tar.gz
zsh-273d669a568ed9ee705916e42945f4239501cdcb.tar.xz
zsh-273d669a568ed9ee705916e42945f4239501cdcb.zip
45001: Fix zero-length matches with ${...%...}
As the shortest match is preferred, zero-length matches beat any other.
Diffstat (limited to 'Test')
-rw-r--r--Test/D04parameter.ztst23
1 files changed, 23 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index b6e85a9fe..c91af1a9c 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -2534,3 +2534,26 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888
 0:Global variables are not trashed by "foo=bar builtin" (regression test)
 >function-value
 >global-value
+
+ foo=pws
+ print ${foo%*}
+0:Smallest match at end can match zero-length string
+>pws
+
+ foo=pws
+ print ${foo%?}
+0:Smallest match at end with a character always matches one
+>pw
+
+ setopt extendedglob
+ foo=pws
+ print ${foo%s#}
+ print ${foo%%s#}
+0:Smallest / largest match with non-trivial closure
+>pws
+>pw
+
+ foo=pws
+ print ${foo%%*}
+0:Largest match at end matches entire string
+>