about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-04-01 14:03:56 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-04-01 14:03:56 +0000
commita78bff4398871023d3913dc259d6a575701f8470 (patch)
treefbc342199684ab3b00ee881e716a6771df9c10be /Test
parent259de0b7424adf73d77a6688962f8d82ba39c796 (diff)
downloadzsh-a78bff4398871023d3913dc259d6a575701f8470.tar.gz
zsh-a78bff4398871023d3913dc259d6a575701f8470.tar.xz
zsh-a78bff4398871023d3913dc259d6a575701f8470.zip
18418: fix select test and add parameter tests
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