t/test.pl fresh_perl_like() bug
hv@crypt.org [Sat, 5 Dec 2009 00:50:02 +0000 (18:50 -0600)]
The existing code does the wrong thing if a string (rather than a compiled
regexp) is supplied for $expected. Happily perl will do the right thing
if you let it.

Hugo

Message-Id: <200912041444.nB4EiqBj004436@zen.crypt.org>

t/test.pl

index bb27794..c0406b0 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -738,9 +738,7 @@ sub fresh_perl_like {
     my($prog, $expected, $runperl_args, $name) = @_;
     local $Level = 2;
     _fresh_perl($prog,
-               sub { @_ ?
-                         $_[0] =~ (ref $expected ? $expected : /$expected/) :
-                         $expected },
+               sub { @_ ? $_[0] =~ $expected : $expected },
                $runperl_args, $name);
 }