Dino Morelli wrote:
I'm working on more p6rules unit tests.

Having some trouble. First, understanding when :w means \s* and when it
means \s+


Also, these tests are failing when I use :: to separate the modifier from the pattern. But they work when I do ':w blah' (separate with a space). I'm not sure which ways are "right".

The actual failing tests:

my $targ = qq{ foobar
baz  quux
zot\tfum};

p6rule_is  ($targ, ':w::baz quux',  'baz\s+quux or baz\s*quux matches');
p6rule_is  ($targ, ':w::zot fum',   'zot\s+fum or zot\s*fum matches');

If I remember right Larry's intent was that it depends on word boundaries. Thus the thing to look at is to put "\b" there instead of the "\s+" or "\s*" and see if the match will still work. I.e., if "\b" would succeed then use "\s*" and if "\b" would fail the use "\s+". Thus both of your examples above should use "\s+" because you want to preserve the separation between the words. So, if the rule was
':w::baz ###', then you'd what to use "\s*" as the white space is not needed to keep them separate.



-- [EMAIL PROTECTED] [EMAIL PROTECTED]

Reply via email to