X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstrictures.t;h=20ca87bdd0e5f3271b99f4c50ed7f00542643007;hb=09dcd779e42c0818abe4220b900b730fc67e1e7e;hp=411bccea0741dfa44d63384ac61e5f80bd3850c2;hpb=9f180a366b9e5ce01c2dda475a5648a2c0d291c1;p=p5sagit%2Fstrictures.git diff --git a/t/strictures.t b/t/strictures.t index 411bcce..20ca87b 100644 --- a/t/strictures.t +++ b/t/strictures.t @@ -2,9 +2,11 @@ BEGIN { $ENV{PERL_STRICTURES_EXTRA} = 0 } sub _eval { eval $_[0] } +use Test::More 0.88; + use strict; use warnings; -use Test::More qw(no_plan); +use Test::More; sub capture_hints { my $code = shift; @@ -56,8 +58,25 @@ my $v; eval { $v = strictures->VERSION; 1 } or diag $@; is $v, $strictures::VERSION, '->VERSION returns version correctly'; -my $next = int $v + 1; +my $next = int $strictures::VERSION + 1; eval qq{ use strictures $next; }; like $@, qr/strictures version $next required/, "Can't use strictures $next (this is version $v)"; + +eval qq{ use strictures {version => $next}; }; + +like $@, qr/Major version specified as $next - not supported/, + "Can't use strictures version option $next (this is version $v)"; + +eval qq{ use strictures {version => undef}; }; + +like $@, qr/Major version specified as undef - not supported/, + "Can't use strictures version option undef"; + +eval qq{ use strictures $strictures::VERSION; }; + +is $@, '', + "Can use current strictures version"; + +done_testing;