Permalink
Browse files

update test suite

  • Loading branch information...
1 parent f17f6b4 commit a9575d67eff077407b1eb1124a02cfd5481f422e @barbie barbie committed Dec 2, 2012
Showing with 40 additions and 8 deletions.
  1. +1 −0 Changes
  2. +3 −1 t/90podtest.t
  3. +3 −0 t/91podcover.t
  4. +4 −1 t/94metatest.t
  5. +24 −4 t/95changedate.t
  6. +5 −2 t/96metatest.t
View
@@ -3,6 +3,7 @@ Revision history for Perl library CPAN-Testers-Fact-PlatformInfo
1.01 2012-12-02
- change file dates changed to meet W3CDTF standards.
+ - upgraded test suite.
1.00 2011-05-25
- initial release.
View
@@ -1,3 +1,6 @@
+#!/usr/bin/perl -w
+use strict;
+
use Test::More;
# Skip if doing a regular install
@@ -7,4 +10,3 @@ plan skip_all => "Author tests not required for installation"
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
-
View
@@ -1,3 +1,6 @@
+#!/usr/bin/perl -w
+use strict;
+
use Test::More;
# Skip if doing a regular install
View
@@ -1,3 +1,6 @@
+#!/usr/bin/perl -w
+use strict;
+
use Test::More;
# Skip if doing a regular install
@@ -7,7 +10,7 @@ plan skip_all => "Author tests not required for installation"
eval "use Test::CPAN::Meta";
plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
-plan no_plan;
+plan 'no_plan';
my $meta = meta_spec_ok(undef,undef,@_);
View
@@ -1,20 +1,40 @@
+#!/usr/bin/perl -w
+use strict;
+
use Test::More;
use IO::File;
-use CPAN::Testers::Fact::PlatformInfo;
# Skip if doing a regular install
plan skip_all => "Author tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );
my $fh = IO::File->new('Changes','r') or plan skip_all => "Cannot open Changes file";
-plan no_plan;
+plan 'no_plan';
+
+use CPAN::Testers::Fact::PlatformInfo;
+my $version = $CPAN::Testers::Fact::PlatformInfo::VERSION;
my $latest = 0;
while(<$fh>) {
next unless(m!^\d!);
- $latest = 1 if(m!^$CPAN::Testers::Fact::PlatformInfo::VERSION!);
- like($_, qr!\d[\d._]+\s+\d{2}/\d{2}/\d{4}!,'... version has a date');
+ $latest = 1 if(m!^$version!);
+
+ # 2012-08-26T01:02 or 2012-08-26T01:02:03 or 2012-08-26T01:02:03.04 or 2012-08-26T01:02+01:00
+
+ like($_, qr!^
+ \d[\d._]+\s+ # version
+ ( \d{4}-\d{2}-\d{2} # 2012-08-26 - YYYY-MM-DD
+ ( T\d{2}:\d{2} # T01:02 - Thh:mm
+ ( :\d{2} # :02 - :ss
+ ( \.\d+ # .2 - .ss (microseconds)
+ )?
+ )?
+ ( (Z|[-+]\d+:\d+) # +01:00 - timezone
+ )?
+ )?
+ )
+ \s*$!x,'... version has a date');
}
is($latest,1,'... latest version not listed');
View
@@ -1,13 +1,16 @@
+#!/usr/bin/perl -w
+use strict;
+
use Test::More;
# Skip if doing a regular install
plan skip_all => "Author tests not required for installation"
unless ( $ENV{AUTOMATED_TESTING} );
eval "use Test::CPAN::Meta::JSON";
-plan skip_all => "TTest::CPAN::Meta::JSON required for testing META.json files" if $@;
+plan skip_all => "Test::CPAN::Meta::JSON required for testing META.json files" if $@;
-plan no_plan;
+plan 'no_plan';
my $meta = meta_spec_ok(undef,undef,@_);

0 comments on commit a9575d6

Please sign in to comment.