Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 66048 invoked from network); 23 Jun 2006 22:27:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jun 2006 22:27:07 -0000 Received: (qmail 87219 invoked by uid 500); 23 Jun 2006 22:27:06 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 86739 invoked by uid 500); 23 Jun 2006 22:27:04 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 86722 invoked by uid 99); 23 Jun 2006 22:27:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 15:27:03 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ats37@hotmail.com designates 65.54.175.40 as permitted sender) Received: from [65.54.175.40] (HELO hotmail.com) (65.54.175.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jun 2006 15:27:00 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 23 Jun 2006 15:26:39 -0700 Message-ID: Received: from 65.54.175.200 by by104fd.bay104.hotmail.msn.com with HTTP; Fri, 23 Jun 2006 22:26:36 GMT X-Originating-IP: [62.49.63.196] X-Originating-Email: [ats37@hotmail.com] X-Sender: ats37@hotmail.com In-Reply-To: From: "Andrew Stevens" To: dev@cocoon.apache.org Subject: Re: svn commit: r416308 - /cocoon/trunk/core/cocoon-core/src/test/java/org/apach Date: Fri, 23 Jun 2006 23:26:36 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 23 Jun 2006 22:26:39.0687 (UTC) FILETIME=[18BDCD70:01C69714] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N >From: Giacomo Pati >Date: Thu, 22 Jun 2006 14:58:05 +0200 (CEST) > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > > >On Thu, 22 Jun 2006, Carsten Ziegeler wrote: > >>Date: Thu, 22 Jun 2006 11:59:35 +0200 >>From: Carsten Ziegeler >>Reply-To: dev@cocoon.apache.org >>To: dev@cocoon.apache.org >>Subject: Re: svn commit: r416308 - >> >>/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/util/Wildca >> rdMatcherHelperTestCase.java >> >>Giacomo Pati wrote: >>>>> >>>>>- public void testEmptyPattern() throws Exception { >>>>>+ public void test21WildcardURIMatch() >>>>>+ throws Exception { >>>>>+ Map result = WildcardMatcherHelper.match("*/**", >>>>>"samples/blocks/"); >>>>>+ assertNotNull(result); >>>>>+ assertEquals("", result.get("1")); >>> >>>Oh, if this test succeeds isn't it wrong? Shouldn't {1}be "samples"? >>> >>Ups, yep - damn copy-paste. I corrected the test case, but it still >>fails as the result is null. > >Ok, looking at those matching sample we need to define how matching is >suppose to work. Consider the following sample > >Pattern String >**/*/** foo/bar/baz/buz/ > >What is the result you expect for {1}, {2}, and {3} ? Possible values could >be: > >{1}="foo" {2}="bar" {3}="baz/buz" >{1}="foo/bar" {2}="baz" {3}="buz" >{1}="foo/bar/baz" {2}="buz" {3}="" > >which one do you think is the correct one? If it were the regex (.*)/([^/]*)/(.*) then what would the result be? Unless there's a compelling reason not to, it might as well behave similarly. I can't test it myself right now, but I think that regex would give the third option (i.e. as greedy as possible as early as it can be). However, if in fact that's not the case, shouldn't {3} include the trailing slash? Andrew.