summaryrefslogtreecommitdiffstats
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
commit56e1904e45cc474a9858dc1205055008f8c63752 (patch)
tree075e089f92f9916e36feee06c38321c58dd1a97d /Test
parent24730: use --no-color when calling git commands that might output color codes. (diff)
downloadzsh-56e1904e45cc474a9858dc1205055008f8c63752.tar
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.gz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.bz2
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.lz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.xz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.zst
zsh-56e1904e45cc474a9858dc1205055008f8c63752.zip
fix optimisation of string matching with multibyte mode
24732: attempt to provide adequate space for sched ztrftime string with multibyte characters
Diffstat (limited to 'Test')
-rw-r--r--Test/D04parameter.ztst37
1 files changed, 37 insertions, 0 deletions
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 79aecb6c3..433f7743b 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -282,6 +282,7 @@
print ${(P)bar}
0:${(P)...}
>I'm nearly out of my mind with tedium
+#' deconfuse emacs
foo=(I could be watching that programme I recorded)
print ${(o)foo}
@@ -375,6 +376,7 @@
print ${(QX)foo}
1:${(QX)...}
?(eval):2: unmatched "
+# " deconfuse emacs
array=(characters in an array)
print ${(c)#array}
@@ -411,6 +413,7 @@
print ${(pl.10..\x22..X.)foo}
0:${(pl...)...}
>Xresulting """"Xwords roariously """Xpadded
+#" deconfuse emacs
print ${(l.5..X.r.5..Y.)foo}
print ${(l.6..X.r.4..Y.)foo}
@@ -870,6 +873,7 @@
0:Parameters associated with backreferences
>match 12 16 match
>1 1 1
+#' deconfuse emacs
string='and look for a MATCH in here'
if [[ ${(S)string%%(#m)M*H} = "and look for a in here" ]]; then
@@ -1010,3 +1014,36 @@
>fields
>in
>it
+
+ array=('%' '$' 'j' '*' '$foo')
+ print ${array[(i)*]} "${array[(i)*]}"
+ print ${array[(ie)*]} "${array[(ie)*]}"
+ key='$foo'
+ print ${array[(ie)$key]} "${array[(ie)$key]}"
+ key='*'
+ print ${array[(ie)$key]} "${array[(ie)$key]}"
+0:Matching array indices with and without quoting
+>1 1
+>4 4
+>5 5
+>4 4
+
+# Ordering of associative arrays is arbitrary, so we need to use
+# patterns that only match one element.
+ typeset -A assoc_r
+ assoc_r=(star '*' of '*this*' and '!that!' or '(the|other)')
+ print ${(kv)assoc_r[(re)*]}
+ print ${(kv)assoc_r[(re)*this*]}
+ print ${(kv)assoc_r[(re)!that!]}
+ print ${(kv)assoc_r[(re)(the|other)]}
+ print ${(kv)assoc_r[(r)*at*]}
+ print ${(kv)assoc_r[(r)*(ywis|bliss|kiss|miss|this)*]}
+ print ${(kv)assoc_r[(r)(this|that|\(the\|other\))]}
+0:Reverse subscripting associative arrays with literal matching
+>star *
+>of *this*
+>and !that!
+>or (the|other)
+>and !that!
+>of *this*
+>or (the|other)