From 56e1904e45cc474a9858dc1205055008f8c63752 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 25 Mar 2008 17:47:10 +0000 Subject: fix optimisation of string matching with multibyte mode 24732: attempt to provide adequate space for sched ztrftime string with multibyte characters --- Test/D04parameter.ztst | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'Test/D04parameter.ztst') 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) -- cgit 1.4.1