From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11672 invoked from network); 6 Jul 2001 05:53:00 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jul 2001 05:53:00 -0000 Received: (qmail 9427 invoked by alias); 6 Jul 2001 05:51:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15270 Received: (qmail 9399 invoked from network); 6 Jul 2001 05:51:54 -0000 From: "Bart Schaefer" Message-Id: <1010706055158.ZM9723@candle.brasslantern.com> Date: Fri, 6 Jul 2001 05:51:58 +0000 In-Reply-To: Comments: In reply to Vin Shelton "Test Failures Latest CVS" (Jul 5, 11:53pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: Vin Shelton , zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: Test Failures Latest CVS MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 5, 11:53pm, Vin Shelton wrote: } Subject: Test Failures Latest CVS } } It's probably a good thing that our test suites are starting to catch } more regressions: } } /usr/local/src/zsh-2001-07-05/Test/D04parameter.ztst: starting. } *** /tmp/zsh.ztst.out.2596 Thu Jul 5 23:19:53 2001 } --- /tmp/zsh.ztst.tout.2596 Thu Jul 5 23:19:53 2001 } *************** } *** 1,4 **** } ! where is the white windmill, wly } --- 1,4 ---- } ! wly } Test /usr/local/src/zsh-2001-07-05/Test/D04parameter.ztst failed: output differs from expected as shown above for: } print ${(S)string%%h*e} This isn't a regression, it's an intentional change; but the test was not brought up to date. The question is, -should- it have been changed? The effect of 15266 is that, with the (S) flag, ## and %% are the same, unless you use (I::); and I think the new meaning of (I::) is even more difficult to understand than it was to explain. Here's before 15266: schaefer[501] foo='where I was standing lizards crawled here and there around' schaefer[502] print ${(S)foo%%h*ere} where I was standing lizards crawled here and t around schaefer[503] print ${(I:2:S)foo%%h*ere} where I was standing lizards crawled around schaefer[504] print ${(I:3:S)foo%%h*ere} w around schaefer[505] foo='where is the white windmill, whispered walter wisely' schaefer[506] print ${(S)foo%%h*e} where is the white windmill, wly schaefer[507] print ${(I:2:S)foo%%h*e} where is the wly schaefer[508] print ${(I:3:S)foo%%h*e} where is tly Here's after 15266: schaefer<501> foo='where I was standing lizards crawled here and there around' schaefer<502> print ${(S)foo%%h*ere} w around schaefer<503> print ${(I:2:S)foo%%h*ere} w and there around schaefer<504> print ${(I:3:S)foo%%h*ere} w I was standing lizards crawled here and there around schaefer<505> foo='where is the white windmill, whispered walter wisely' schaefer<506> print ${(S)foo%%h*e} wly schaefer<507> print ${(I:2:S)foo%%h*e} wr wisely schaefer<508> print ${(I:3:S)foo%%h*e} wd walter wisely This seems backwards to me. Indices with % and %% should count from the end of the string leftwards, not from the beginning of the string rightwards, and always before it has been the case that the indices are for the -start- of the match, not for the end of it. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net