summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/lib/version/t
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
committerafresh1 <afresh1@openbsd.org>2014-03-24 14:58:42 +0000
commit91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch)
tree3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/lib/version/t
parentdo not call purge_task every 10 secs, it is only needed once at startup and (diff)
downloadwireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz
wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/lib/version/t')
-rw-r--r--gnu/usr.bin/perl/lib/version/t/01base.t14
-rw-r--r--gnu/usr.bin/perl/lib/version/t/02derived.t2
-rw-r--r--gnu/usr.bin/perl/lib/version/t/03require.t2
-rw-r--r--gnu/usr.bin/perl/lib/version/t/05sigdie.t2
-rw-r--r--gnu/usr.bin/perl/lib/version/t/06noop.t2
-rw-r--r--gnu/usr.bin/perl/lib/version/t/07locale.t4
-rw-r--r--gnu/usr.bin/perl/lib/version/t/coretests.pm12
7 files changed, 31 insertions, 7 deletions
diff --git a/gnu/usr.bin/perl/lib/version/t/01base.t b/gnu/usr.bin/perl/lib/version/t/01base.t
index f5784cd568c..9aa8052a303 100644
--- a/gnu/usr.bin/perl/lib/version/t/01base.t
+++ b/gnu/usr.bin/perl/lib/version/t/01base.t
@@ -9,7 +9,7 @@ use Test::More qw/no_plan/;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
require $coretests;
- use_ok('version', 0.97);
+ use_ok('version', 0.9902);
}
diag "Tests with base class" unless $ENV{PERL_CORE};
@@ -32,3 +32,15 @@ my $v = eval {
return IO::Handle->VERSION;
};
ok defined($v), 'Fix for RT #47980';
+
+{ # https://rt.cpan.org/Ticket/Display.html?id=81085
+ eval { version::new() };
+ like $@, qr'Usage: version::new\(class, version\)',
+ 'No bus err when called as function';
+ eval { $x = 1; print version::new };
+ like $@, qr'Usage: version::new\(class, version\)',
+ 'No implicit object creation when called as function';
+ eval { $x = "version"; print version::new };
+ like $@, qr'Usage: version::new\(class, version\)',
+ 'No implicit object creation when called as function';
+}
diff --git a/gnu/usr.bin/perl/lib/version/t/02derived.t b/gnu/usr.bin/perl/lib/version/t/02derived.t
index 3ea847eb140..c7afe0f9af8 100644
--- a/gnu/usr.bin/perl/lib/version/t/02derived.t
+++ b/gnu/usr.bin/perl/lib/version/t/02derived.t
@@ -10,7 +10,7 @@ use File::Temp qw/tempfile/;
BEGIN {
(my $coretests = $0) =~ s'[^/]+\.t'coretests.pm';
require $coretests;
- use_ok("version", 0.97);
+ use_ok("version", 0.9902);
# If we made it this far, we are ok.
}
diff --git a/gnu/usr.bin/perl/lib/version/t/03require.t b/gnu/usr.bin/perl/lib/version/t/03require.t
index 90d33ebabeb..66c6bd3a85b 100644
--- a/gnu/usr.bin/perl/lib/version/t/03require.t
+++ b/gnu/usr.bin/perl/lib/version/t/03require.t
@@ -14,7 +14,7 @@ BEGIN {
# Don't want to use, because we need to make sure that the import doesn't
# fire just yet (some code does this to avoid importing qv() and delare()).
require_ok("version");
-is $version::VERSION, 0.99, "Make sure we have the correct class";
+is $version::VERSION, 0.9902, "Make sure we have the correct class";
ok(!"main"->can("qv"), "We don't have the imported qv()");
ok(!"main"->can("declare"), "We don't have the imported declare()");
diff --git a/gnu/usr.bin/perl/lib/version/t/05sigdie.t b/gnu/usr.bin/perl/lib/version/t/05sigdie.t
index 2a333392e5e..188f185587a 100644
--- a/gnu/usr.bin/perl/lib/version/t/05sigdie.t
+++ b/gnu/usr.bin/perl/lib/version/t/05sigdie.t
@@ -15,7 +15,7 @@ BEGIN {
BEGIN {
- use version 0.97;
+ use version 0.9902;
}
pass "Didn't get caught by the wrong DIE handler, which is a good thing";
diff --git a/gnu/usr.bin/perl/lib/version/t/06noop.t b/gnu/usr.bin/perl/lib/version/t/06noop.t
index 63f707300b1..9d113ed6e41 100644
--- a/gnu/usr.bin/perl/lib/version/t/06noop.t
+++ b/gnu/usr.bin/perl/lib/version/t/06noop.t
@@ -7,7 +7,7 @@
use Test::More qw/no_plan/;
BEGIN {
- use_ok('version', 0.97);
+ use_ok('version', 0.9902);
}
my $v1 = version->new('1.2');
diff --git a/gnu/usr.bin/perl/lib/version/t/07locale.t b/gnu/usr.bin/perl/lib/version/t/07locale.t
index 506b1bf50f8..3b67f3d77af 100644
--- a/gnu/usr.bin/perl/lib/version/t/07locale.t
+++ b/gnu/usr.bin/perl/lib/version/t/07locale.t
@@ -8,13 +8,15 @@ use File::Basename;
use File::Temp qw/tempfile/;
use POSIX qw/locale_h/;
use Test::More tests => 7;
+use Config;
BEGIN {
- use_ok('version', 0.97);
+ use_ok('version', 0.9902);
}
SKIP: {
skip 'No locale testing for Perl < 5.6.0', 6 if $] < 5.006;
+ skip 'No locale testing without d_setlocale', 6 if(!$Config{d_setlocale});
# test locale handling
my $warning;
local $SIG{__WARN__} = sub { $warning = $_[0] };
diff --git a/gnu/usr.bin/perl/lib/version/t/coretests.pm b/gnu/usr.bin/perl/lib/version/t/coretests.pm
index 3f785e47263..15a1f1ff8c9 100644
--- a/gnu/usr.bin/perl/lib/version/t/coretests.pm
+++ b/gnu/usr.bin/perl/lib/version/t/coretests.pm
@@ -505,6 +505,7 @@ EOF
}
{
+ local $Data::Dumper::Sortkeys= 1;
# http://rt.cpan.org/Public/Bug/Display.html?id=30004
my $v1 = $CLASS->$method("v0.1_1");
(my $alpha1 = Dumper($v1)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms;
@@ -538,9 +539,10 @@ EOF
{
# https://rt.cpan.org/Ticket/Display.html?id=72365
# https://rt.perl.org/rt3/Ticket/Display.html?id=102586
+ # https://rt.cpan.org/Ticket/Display.html?id=78328
eval 'my $v = $CLASS->$method("version")';
like $@, qr/Invalid version format/,
- 'The string "version" is not a version';
+ "The string 'version' is not a version for $method";
eval 'my $v = $CLASS->$method("ver510n")';
like $@, qr/Invalid version format/,
'All strings starting with "v" are not versions';
@@ -593,6 +595,14 @@ SKIP: {
eval { _112478->VERSION(9e99) };
unlike $@, qr/panic/, '->VERSION(9e99) does not panic';
}
+
+ { # https://rt.cpan.org/Ticket/Display.html?id=79259
+ my $v = $CLASS->new("0.52_0");
+ ok $v->is_alpha, 'Just checking';
+ is $v->numify, '0.520', 'Correctly nummified';
+ }
+
}
1;
+