summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Test/A01grammar.ztst3
-rw-r--r--Test/D04parameter.ztst22
3 files changed, 30 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 40c0ca7b4..8ade227f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-01 Peter Stephenson <pws@csr.com>
+
+ * 18418: Test/A01grammar.ztst, Test/D04parameter.ztst:
+ fix select test from 18389 and add tests for $MATCH and $match
+ and related parameters.
+
2003-03-31 Felix Rosencrantz <f_rosencrantz@yahoo.com>
* unposted: Functions/TCP/.distfiles: Removed zgprintf, file was
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