When writing tests using Test::More, we should put some phrase
like this in Makefile.PL:

  WriteMakefile(
      'NAME'    => 'Foobar',
      'VERSION_FROM' => 'Foobar.pm', # finds $VERSION
      'PREREQ_PM' => {
          'Test::More' => 0.08,
      },
  );


This will lead to the following error, caused by eval()ing
standalone "use Test::More".

  Odd number of elements in hash assignment at
  /usr/local/lib/perl5/site_perl/5.005/Test/Simple.pm line 32.
  Warning: prerequisite Test::More 0.08 not found at (eval 1) line 219.


Patch follows. Thanks.


--- Test-Simple-0.12.orig/lib/Test/More.pm      Wed Aug 15 01:18:21 2001
+++ Test-Simple-0.12/lib/Test/More.pm   Wed Aug 15 01:18:59 2001
@@ -25,15 +25,15 @@


 sub import {
-    my($class, $plan, @args) = @_;
+    my($class, @args) = @_;

-    if( $plan eq 'skip_all' ) {
+    if( @args > 0 && $args[0] eq 'skip_all' ) {
         $Test::Simple::Skip_All = 1;
         my_print *TESTOUT, "1..0\n";
         exit(0);
     }
     else {
-        Test::Simple->import($plan => @args);
+        Test::Simple->import(@args);
     }

     __PACKAGE__->_export_to_level(1, __PACKAGE__);





--
Tatsuhiko Miyagawa
mailto:[EMAIL PROTECTED]

Reply via email to