develooper Front page | perl.perl5.porters | Postings from April 2006

Re: [PATCH] t/op/pat.t using test.pl

Thread Previous | Thread Next
From:
David Landgren
Date:
April 27, 2006 10:26
Subject:
Re: [PATCH] t/op/pat.t using test.pl
Message ID:
4450FEA7.5020202@landgren.net
Jim Cromie wrote:

> You might consider your own Ok(), starting with Yves' or Ron's snippets,
> which wraps 2 checks into 1 call.

But the line numbers will point to the custom ok(), rather than the line 
in pat.t

> <aside>  does like() reset $1 etal ? </>

Irrelevant here. I went so far as replace

   $@ ~= /^\QQuantifier in {,} bigger than 32766 in regex/

by

   my $fail_msg = 'Quantifier in {,} bigger than 32766 in regex';
   cmp_ok(substr($@,0,length($fail_msg)), 'eq', $fail_msg);

... so that regexps aren't used to determine the result of a regexp 
test. And as $1, $2 scopes are bound to curlies that's enough to work with.

DAvid
-- 
"It's overkill of course, but you can never have too much overkill."


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About