[EMAIL PROTECTED] wrote:
stas 2003/08/13 15:00:25
Modified: perl-framework/Apache-Test/lib/Apache Test.pm
Log:
trick ok() into reporting the caller filename/line when a
sub-test fails in sok()
I love Perl!
- ok $sub->();
+ my($package, $filename, $line) = caller;
+
+ # trick ok() into reporting the caller filename/line when a
+ # sub-test fails in sok()
+ return eval <<EOE;
+#line $line $filename
+ ok(\$sub->());
+EOE
}
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com