cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: svn commit: r416308 - /cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/util/WildcardMatcherHelperTestCase.java
Date Thu, 22 Jun 2006 12:58:05 GMT
-----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 <cziegeler@apache.org>
> 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?

I probably need to consider reversing the algorithm anyway (scanning 
from start to end instead from end to start)

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEmpPiLNdJvZjjVZARAjVNAKCiL60U1bw/WlWny9hVPpBXUl3H9gCg2KB2
L63tsrcfNDFnrer3/QYfDL0=
=rG/R
-----END PGP SIGNATURE-----

Mime
View raw message