summaryrefslogtreecommitdiff
path: root/cpan/experimental
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-08-21 11:07:03 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-08-21 13:03:34 +0100
commitf8c3bb9cd563201d0de7aabc4a0717d789dddd3d (patch)
tree4447dd4df49331af7b1fafa4a1c3d314e9018265 /cpan/experimental
parente8a1320429af495b757bf4a64f8bb2aebd84fa8b (diff)
downloadperl-f8c3bb9cd563201d0de7aabc4a0717d789dddd3d.tar.gz
Update experimental to CPAN version 0.010
[DELTA] 0.010 2014-08-19 17:47:20+02:00 Europe/Amsterdam Add returning 1's to evals in tests 0.009 2014-08-16 13:43:53+02:00 Europe/Amsterdam Hardcode features for perl < 5.15.7
Diffstat (limited to 'cpan/experimental')
-rw-r--r--cpan/experimental/lib/experimental.pm37
-rw-r--r--cpan/experimental/t/basic.t18
2 files changed, 46 insertions, 9 deletions
diff --git a/cpan/experimental/lib/experimental.pm b/cpan/experimental/lib/experimental.pm
index 96f8a419ec..10a6a10516 100644
--- a/cpan/experimental/lib/experimental.pm
+++ b/cpan/experimental/lib/experimental.pm
@@ -1,5 +1,5 @@
package experimental;
-$experimental::VERSION = '0.008';
+$experimental::VERSION = '0.010';
use strict;
use warnings;
use version ();
@@ -8,16 +8,35 @@ use feature ();
use Carp qw/croak carp/;
my %warnings = map { $_ => 1 } grep { /^experimental::/ } keys %warnings::Offsets;
-my %features = map { $_ => 1 } keys %feature::feature;
+my %features = map { $_ => 1 } $] > 5.015006 ? keys %feature::feature : do {
+ my @features;
+ if ($] >= 5.010) {
+ push @features, qw/switch say state/;
+ push @features, 'unicode_strings' if $] > 5.011002;
+ }
+ @features;
+};
my %min_version = (
- array_base => version->new('5'),
- autoderef => version->new('5.14.0'),
- lexical_topic => version->new('5.10.0'),
- regex_sets => version->new('5.18.0'),
- smartmatch => version->new('5.10.1'),
- signatures => version->new('5.20.0'),
+ array_base => '5',
+ autoderef => '5.14.0',
+ current_sub => '5.16.0',
+ evalbytes => '5.16.0',
+ fc => '5.16.0',
+ lexical_topic => '5.10.0',
+ lexical_subs => '5.18.0',
+ postderef => '5.20.0',
+ postderef_qq => '5.20.0',
+ regex_sets => '5.18.0',
+ say => '5.10.0',
+ smartmatch => '5.10.0',
+ signatures => '5.20.0',
+ state => '5.10.0',
+ switch => '5.10.0',
+ unicode_eval => '5.16.0',
+ unicode_strings => '5.12.0',
);
+$_ = version->new($_) for values %min_version;
my %additional = (
postderef => ['postderef_qq'],
@@ -93,7 +112,7 @@ experimental - Experimental features made easy
=head1 VERSION
-version 0.008
+version 0.010
=head1 SYNOPSIS
diff --git a/cpan/experimental/t/basic.t b/cpan/experimental/t/basic.t
index bb1ed81866..239225b8a3 100644
--- a/cpan/experimental/t/basic.t
+++ b/cpan/experimental/t/basic.t
@@ -9,6 +9,7 @@ if ($] >= 5.010000) {
use experimental 'lexical_topic';
my $_ = 1;
is($_, 1, '$_ is 1');
+ 1;
END
}
else {
@@ -16,10 +17,27 @@ else {
}
if ($] >= 5.010001) {
+ is (eval <<'END', 1, 'switch compiles') or diag $@;
+ use experimental 'switch';
+ sub bar { 1 };
+ given(1) {
+ when (\&bar) {
+ pass("bar matches 1");
+ }
+ default {
+ fail("bar matches 1");
+ }
+ }
+ 1;
+END
+}
+
+if ($] >= 5.010001) {
is (eval <<'END', 1, 'smartmatch compiles') or diag $@;
use experimental 'smartmatch';
sub bar { 1 };
is(1 ~~ \&bar, 1, "is 1");
+ 1;
END
}