develooper Front page | perl.perl5.porters | Postings from May 2007

[PATCH] minor assertions improvements

Thread Next
Ricardo SIGNES
May 30, 2007 18:48
[PATCH] minor assertions improvements
Message ID:

Okay, here's my first swing at improving the default core implementation of

1. says "if the entry in @{^ASSERTING} is ref-eq-Regexp, match
    it; otherwise, call the 'check' method on it"

    The patch uses re::is_regexp instead of ref eq, and calls the non-regex
    values as subrefs.  This is a smidge closer to using ~~, which is probably
    what a non-back-compat matcher would do.

2.  makes assertions::activate pass non-regex refs through unaltered, rather
    than stringifying and qr//-wrapping them; this meant that the "as object"
    assertions could never be activated with the core activator

3.  tests the above

I think there's a long way to go to make these great, but I think that making
things more ~~-compatible will help with future improved assertions


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About