X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fversion.t;h=8823f23f2d4d9377ba9317788fa14d908373660e;hb=b6c146dd05d7f6ee2801592b9ba97b59966f4411;hp=4d4a791628052d205451891ee4b37fc564d6f557;hpb=a7ad731c5ef0d5f23c440149f8f810a4785a2903;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/version.t b/lib/version.t index 4d4a791..8823f23 100644 --- a/lib/version.t +++ b/lib/version.t @@ -1,10 +1,10 @@ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' -# $Revision: 2.0 $ +# $Revision: 2.1 $ ######################### -use Test::More tests => 60; +use Test::More tests => 64; use_ok(version); # If we made it this far, we are ok. my ($version, $new_version); @@ -34,6 +34,14 @@ eval {my $version = new version "1.2_3.4";}; like($@, qr/underscores before decimal/, "Invalid version format (underscores before decimal)"); +$version = new version "99 and 44/100 pure"; +ok ("$version" eq "99.0", '$version eq "99.0"'); +ok ($version->numify == 99.0, '$version->numify == 99.0'); + +$version = new version "something"; +ok ("$version" eq "", '$version eq ""'); +ok ($version->numify == 0, '$version->numify == 99.0'); + # Test boolean operator ok ($version, 'boolean');