On Thu, Nov 23, 2006 at 03:09:11PM -0800, Nuno Carvalho via RT wrote:
> I've tried to add some tests to the rx_subrule with some extras
> sensitive cases, but i'm failling two tests that i think that should
> pass. I have attached a patch that adds new tests. The ones requiring
> attention are the ones that fail. 

Excellent, thanks!

The two tests you contributed that were failing likely weren't testing
what you thought they were testing.  The original tests were:

     Pattern         Target     Match (y/n)
    <-[ab]+[cd]>+     caad         n
    <+alpha-[Jj]>+    aJc          n

Since the patterns are unanchored, the first test simply matches
any sequence of 'c' and 'd' characters, while the second matches
any sequence of alphabetic characters other than 'J' or 'j'.

So, being unconstrained, the first pattern matches the 'caad'
target by matching the initial 'c', and the second pattern
likewise matches the initial 'a'.

I've applied the patch (thanks!) and changed these two failing
tests to be anchored patterns, as in:

     Pattern           Target     Match (y/n)
    ^<-[ab]+[cd]>+$     caad         n
    ^<+alpha-[Jj]>+$    aJc          n

They now work as expected.

Thanks again!

Pm

Reply via email to