Yitzchak points out that this function argument is NULLOK
[p5sagit/p5-mst-13.2.git] / lib / version.t
index e387095..c60d656 100644 (file)
@@ -18,7 +18,7 @@ diag "Tests with empty derived class" unless $ENV{PERL_CORE};
 
 package version::Empty;
 use vars qw($VERSION @ISA);
-use version 0.30;
+use version;
 @ISA = qw(version);
 $VERSION = 0.01;
 
@@ -109,7 +109,7 @@ sub BaseTests {
        ok ($version, 'boolean');
        
        # Test class membership
-       isa_ok ( $version, "version" );
+       isa_ok ( $version, $CLASS );
        
        # Test comparison operators with self
        diag "tests with self" unless $ENV{PERL_CORE};
@@ -238,7 +238,7 @@ sub BaseTests {
 
        # test creation from existing version object
        diag "create new from existing version" unless $ENV{PERL_CORE};
-       ok (eval {$new_version = version->new($version)},
+       ok (eval {$new_version = $CLASS->new($version)},
                "new from existing object");
        ok ($new_version == $version, "class->new($version) identical");
        $new_version = $version->new();
@@ -248,9 +248,9 @@ sub BaseTests {
 
        # test the CVS revision mode
        diag "testing CVS Revision" unless $ENV{PERL_CORE};
-       $version = new version qw$Revision: 1.2$;
+       $version = new $CLASS qw$Revision: 1.2$;
        ok ( $version eq "1.2.0", 'qw$Revision: 1.2$ eq 1.2.0' );
-       $version = new version qw$Revision: 1.2.3.4$;
+       $version = new $CLASS qw$Revision: 1.2.3.4$;
        ok ( $version eq "1.2.3.4", 'qw$Revision: 1.2.3.4$ eq 1.2.3.4' );
        
        # test the CPAN style reduced significant digit form
@@ -320,3 +320,5 @@ SKIP:       {
        ok($version->numify eq "1.700", "leading space ignored");
 
 }
+
+1;