From: Nicholas Clark Date: Thu, 8 Oct 2009 19:58:17 +0000 (+0200) Subject: Move tests for use for "new style version numbers" to use.t from require.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2a3bb21a1100f37023e2a89faccca76359cd969;p=p5sagit%2Fp5-mst-13.2.git Move tests for use for "new style version numbers" to use.t from require.t --- diff --git a/t/comp/require.t b/t/comp/require.t index 0a2293b..06a3421 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -22,7 +22,7 @@ krunch.pm krunch.pmc whap.pm whap.pmc); my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; my $Is_UTF8 = (${^OPEN} || "") =~ /:utf8/; -my $total_tests = 49; +my $total_tests = 47; if ($Is_EBCDIC || $Is_UTF8) { $total_tests -= 3; } print "1..$total_tests\n"; @@ -62,14 +62,6 @@ eval { require 10.0.2; }; print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/; print "ok ",$i++,"\n"; -eval q{ use v5.5.630; }; -print "# $@\nnot " if $@; -print "ok ",$i++,"\n"; - -eval q{ use 10.0.2; }; -print "# $@\nnot " unless $@ =~ /^Perl v10\.0\.2 required/; -print "ok ",$i++,"\n"; - my $ver = 5.005_63; eval { require $ver; }; print "# $@\nnot " if $@; diff --git a/t/comp/use.t b/t/comp/use.t index a7ecda8..ba7d587 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -6,7 +6,7 @@ BEGIN { $INC{"feature.pm"} = 1; # so we don't attempt to load feature.pm } -print "1..68\n"; +print "1..70\n"; # Can't require test.pl, as we're testing the use/require mechanism here. @@ -62,6 +62,14 @@ sub isnt ($$;$) { _ok ('isnt', @_); } +# new style version numbers + +eval q{ use v5.5.630; }; +is ($@, ''); + +eval q{ use 10.0.2; }; +like ($@, qr/^Perl v10\.0\.2 required/); + eval "use 5.000"; # implicit semicolon is ($@, '');