-----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 <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
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-----