about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
Diffstat (limited to 'Test')
-rw-r--r--Test/A01grammar.ztst3
-rw-r--r--Test/D04parameter.ztst22
2 files changed, 24 insertions, 1 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 918f77c0a..6f40c98ab 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -233,10 +233,11 @@
 
 ## Select now reads from stdin if the shell is not interactive.
 ## Its own output goes to stderr.
+  (COLUMNS=80
   PS3="input> "
   select name in one two three; do
     print $name
-  done
+  done)
 0:`select' loop
 <2
 ?1) one     2) two     3) three   
diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst
index 37b5a1897..77964a741 100644
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -555,3 +555,25 @@
 >/here:/there
 >0
 >/elsewhere /somewhere
+
+  string='look for a match in here'
+  if [[ ${string%%(#b)(match)*} = "look for a " ]]; then
+    print $match[1] $mbegin[1] $mend[1] $string[$mbegin[1],$mend[1]]
+    print $#match $#mbegin $#mend
+  else
+    print That didn\'t work.
+  fi
+0:Parameters associated with backreferences
+>match 12 16 match
+>1 1 1
+
+  string='and look for a MATCH in here'
+  if [[ ${(S)string%%(#m)M*H} = "and look for a  in here" ]]; then
+    print $MATCH $MBEGIN $MEND $string[$MBEGIN,$MEND]
+    print $#MATCH
+  else
+    print Oh, dear.  Back to the drawing board.
+  fi
+0:Parameters associated with (#m) flag
+>MATCH 16 20 MATCH
+>5