summaryrefslogtreecommitdiff
path: root/cpan/version
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@cpan.org>2013-12-25 14:19:19 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-01-04 05:10:04 -0800
commit95a23f5d4555e7aada6ee78c54dec1abd1521aec (patch)
treed51f669cddba48f992a0e9dd03412300bc9e740a /cpan/version
parent4141ef59170e80715499432a2f4b9bfca704247d (diff)
downloadperl-95a23f5d4555e7aada6ee78c54dec1abd1521aec.tar.gz
Grab latest changes from CPAN 0.9905
Diffstat (limited to 'cpan/version')
-rw-r--r--cpan/version/t/07locale.t6
-rw-r--r--cpan/version/t/09_list_util.t37
2 files changed, 40 insertions, 3 deletions
diff --git a/cpan/version/t/07locale.t b/cpan/version/t/07locale.t
index 15247d0262..a3c75c0bf5 100644
--- a/cpan/version/t/07locale.t
+++ b/cpan/version/t/07locale.t
@@ -22,8 +22,6 @@ SKIP: {
# test locale handling
my $warning;
- use locale;
-
local $SIG{__WARN__} = sub { $warning = $_[0] };
my $ver = 1.23; # has to be floating point number
@@ -33,10 +31,12 @@ SKIP: {
# because have to
# evaluate in current
# scope
+ use locale;
+
while (<DATA>) {
chomp;
$loc = setlocale( LC_ALL, $_);
- last if localeconv()->{decimal_point} eq ',';
+ last if $loc && localeconv()->{decimal_point} eq ',';
}
skip 'Cannot test locale handling without a comma locale', 5
unless $loc and localeconv()->{decimal_point} eq ',';
diff --git a/cpan/version/t/09_list_util.t b/cpan/version/t/09_list_util.t
new file mode 100644
index 0000000000..f7fb89f021
--- /dev/null
+++ b/cpan/version/t/09_list_util.t
@@ -0,0 +1,37 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+use strict;
+use Test::More tests => 3;
+use_ok("version", 0.9905);
+
+# do strict lax tests in a sub to isolate a package to test importing
+SKIP: {
+ eval "use List::Util qw(reduce);";
+ skip 'No reduce() in List::Util', 2
+ if $@;
+
+ # use again to get the import()
+ use List::Util qw(reduce);
+ {
+ my $fail = 0;
+ my $ret = reduce {
+ version->parse($a);
+ $fail++ unless defined $a;
+ 1
+ } "0.039", "0.035";
+ is $fail, 0, 'reduce() with parse';
+ }
+
+ {
+ my $fail = 0;
+ my $ret = reduce {
+ version->qv($a);
+ $fail++ unless defined $a;
+ 1
+ } "0.039", "0.035";
+ is $fail, 0, 'reduce() with qv';
+ }
+}