Hi, Hmmm... All seems sensible. Patch attached for Builder.pm that adds a _may_be_regex method. Okay?
New version of Test::Exception at <http://www.quietstars.com/perl/>. Anything else :-) Cheers, Adrian on 10/4/02 4:00 pm, Michael G Schwern at [EMAIL PROTECTED] wrote: > On Wed, Apr 10, 2002 at 11:03:27AM +0100, Mark Fowler wrote: >> On Tue, 9 Apr 2002, Adrian Howard wrote: >> >>> Any comments before I throw it at CPAN? Sound vaguely sane? >> >> throws_ok can take either a class name or a Regexp ref as an argument to >> compare against. With earlier versions of perl you can't use the qr// >> operator, so you can't pass regex. Maybe it would be possible to take a >> leaf out of Test::Builder's book for this: >> >> # Check if it looks like '/foo/' >> elsif( my($re, $opts) = $regex =~ m{^ /(.*)/ (\w*) $ }sx ) { >> $usable_regex = "(?$opts)$re"; >> } > > You could even tear that out of Test::Builder->like and into it's own > Test::Builder->may_be_regex method so you don't have to duplicate > code. > -- e. [EMAIL PROTECTED], t. 01929 550720, f. 0870 131 3033