This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade CPAN-Meta-YAML from version 0.014 to 0.016
authorSteve Hay <steve.m.hay@googlemail.com>
Fri, 5 Jun 2015 07:36:40 +0000 (08:36 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Fri, 5 Jun 2015 07:36:40 +0000 (08:36 +0100)
MANIFEST
Porting/Maintainers.pl
cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
cpan/CPAN-Meta-YAML/t/00-report-prereqs.dd
cpan/CPAN-Meta-YAML/t/12_write.t
cpan/CPAN-Meta-YAML/t/21_yamlpm_compat.t
cpan/CPAN-Meta-YAML/t/lib/TestBridge.pm
cpan/CPAN-Meta-YAML/t/tml
cpan/CPAN-Meta-YAML/t/tml-local/load-error/document.tml
cpan/CPAN-Meta-YAML/t/tml-local/load-warning/document.tml [new file with mode: 0644]
pod/perldelta.pod

index 0bf9222..82efabc 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -353,6 +353,7 @@ cpan/CPAN-Meta-YAML/t/tml-local/dump-error/circular.tml
 cpan/CPAN-Meta-YAML/t/tml-local/load-error/document.tml
 cpan/CPAN-Meta-YAML/t/tml-local/load-error/scalar.tml
 cpan/CPAN-Meta-YAML/t/tml-local/load-error/tag.tml
+cpan/CPAN-Meta-YAML/t/tml-local/load-warning/document.tml
 cpan/CPAN-Meta-YAML/t/tml-local/perl-to-yaml/quoting.tml
 cpan/CPAN-Meta-YAML/t/tml-local/yaml-roundtrip/collection.tml
 cpan/CPAN-Meta-YAML/t/tml-local/yaml-roundtrip/comment.tml
index 872d86b..d6ebdff 100755 (executable)
@@ -305,12 +305,11 @@ use File::Glob qw(:case);
     },
 
     'CPAN::Meta::YAML' => {
-        'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-YAML-0.012.tar.gz',
+        'DISTRIBUTION' => 'DAGOLDEN/CPAN-Meta-YAML-0.016.tar.gz',
         'FILES'        => q[cpan/CPAN-Meta-YAML],
         'EXCLUDED'     => [
-            't/00-compile.t',
             't/00-report-prereqs.t',
-            't/04_scalar.t',    # requires YAML.pm
+            't/00-report-prereqs.dd',
             qr{^xt},
         ],
     },
index 604a645..96ed0ca 100644 (file)
@@ -1,11 +1,11 @@
 use 5.008001; # sane UTF-8 support
 use strict;
 use warnings;
-package CPAN::Meta::YAML; # git description: v1.65-6-gfa117d1
+package CPAN::Meta::YAML; # git description: v1.66-5-ge09e1ae
 # XXX-INGY is 5.8.1 too old/broken for utf8?
 # XXX-XDG Lancaster consensus was that it was sufficient until
 # proven otherwise
-$CPAN::Meta::YAML::VERSION = '0.014';
+$CPAN::Meta::YAML::VERSION = '0.016';
 ; # original $VERSION removed by Doppelgaenger
 
 #####################################################################
@@ -512,7 +512,7 @@ sub _load_hash {
         }
 
         if ( exists $hash->{$key} ) {
-            die \"CPAN::Meta::YAML found a duplicate key '$key' in line '$lines->[0]'";
+            warn "CPAN::Meta::YAML found a duplicate key '$key' in line '$lines->[0]'";
         }
 
         # Do we have a value?
@@ -878,7 +878,7 @@ CPAN::Meta::YAML - Read and write a subset of YAML for CPAN Meta files
 
 =head1 VERSION
 
-version 0.014
+version 0.016
 
 =head1 SYNOPSIS
 
index 589a97a..98d00aa 100644 (file)
@@ -51,7 +51,7 @@ do { my $x = {
                                    'File::Find' => '0',
                                    'File::Spec' => '0',
                                    'File::Spec::Functions' => '0',
-                                   'File::Temp' => '0.18',
+                                   'File::Temp' => '0.19',
                                    'IO::Dir' => '0',
                                    'JSON::PP' => '0',
                                    'Test::More' => '0.99',
index 4c099e4..b4be78a 100644 (file)
@@ -9,7 +9,7 @@ use TestUtils;
 use CPAN::Meta::YAML;
 use File::Basename qw/basename/;
 use File::Spec::Functions 'catfile';
-use File::Temp 0.18;
+use File::Temp 0.19; # newdir
 
 #--------------------------------------------------------------------------#
 # Error conditions
index aa58711..944ceff 100644 (file)
@@ -4,7 +4,7 @@ use lib 't/lib/';
 use Test::More 0.99;
 use TestBridge;
 use File::Spec::Functions 'catfile';
-use File::Temp 0.18;
+use File::Temp 0.19; # newdir
 
 #--------------------------------------------------------------------------#
 # This file test that the YAML.pm compatible Dump/Load/DumpFile/LoadFile
index addec9a..eb2ebe7 100644 (file)
@@ -24,6 +24,7 @@ our @EXPORT = qw{
     test_perl_to_yaml
     test_dump_error
     test_load_error
+    test_load_warning
     test_yaml_json
     test_code_point
     error_like
@@ -38,6 +39,9 @@ my %ERROR = (
     E_FEATURE  => qr{\QCPAN::Meta::YAML does not support a feature},
     E_PLAIN    => qr{\QCPAN::Meta::YAML found illegal characters in plain scalar},
     E_CLASSIFY => qr{\QCPAN::Meta::YAML failed to classify the line},
+);
+
+my %WARN = (
     E_DUPKEY   => qr{\QCPAN::Meta::YAML found a duplicate key},
 );
 
@@ -78,6 +82,9 @@ sub run_testml_file {
     $code->($file, $blocks);
 }
 
+# retrieves all the keys in @point from the $block hash, returning them in
+# order, along with $block->{Label}.
+# returns false if any keys cannot be found
 sub _testml_has_points {
     my ($block, @points) = @_;
     my @values;
@@ -251,6 +258,41 @@ sub test_load_error {
 }
 
 #--------------------------------------------------------------------------#
+# test_load_warning
+#
+# two blocks: yaml, warning
+#
+# Tests that a YAML string results in warning when loaded
+#
+# The warning must be a key in the %WARN hash in this file
+#--------------------------------------------------------------------------#
+sub test_load_warning {
+    my ($block) = @_;
+
+    my ($yaml, $warning, $label) =
+      _testml_has_points($block, qw(yaml warning)) or return;
+
+    chomp $warning;
+    my $expected = $WARN{$warning};
+
+    subtest $label, sub {
+        # this is not in a sub like warning_like because of the danger of
+        # matching the regex parameter against something earlier in the stack
+        my @warnings;
+        local $SIG{__WARN__} = sub { push @warnings, shift; };
+
+        my $result = eval { CPAN::Meta::YAML->read_string( $yaml ) };
+
+        is(scalar(@warnings), 1, 'got exactly one warning');
+        like(
+            $warnings[0],
+            $expected,
+            'Got expected warning',
+        ) or diag "YAML:\n$yaml\n", 'warning: ', explain(\@warnings);
+    };
+}
+
+#--------------------------------------------------------------------------#
 # test_yaml_json
 #
 # two blocks: yaml, json
index 4ae95e9..d4e3fe7 100755 (executable)
@@ -17,6 +17,7 @@ use TestUtils;
 my %BRIDGE_MAP = (
     'tml-local/dump-error'      => \&test_dump_error,
     'tml-local/load-error'      => \&test_load_error,
+    'tml-local/load-warning'    => \&test_load_warning,
     'tml-local/perl-to-yaml'    => \&test_perl_to_yaml,
     'tml-local/yaml-roundtrip'  => \&test_yaml_roundtrip,
     'tml-spec/basic-data.tml'   => \&test_yaml_json,
index 9e881f4..454c5d0 100644 (file)
@@ -3,9 +3,3 @@
 \--- foo
 a: 1
 --- error: E_CLASSIFY
-
-=== mapping with double key
---- yaml
-foo: 1
-foo: 2
---- error: E_DUPKEY
diff --git a/cpan/CPAN-Meta-YAML/t/tml-local/load-warning/document.tml b/cpan/CPAN-Meta-YAML/t/tml-local/load-warning/document.tml
new file mode 100644 (file)
index 0000000..482a490
--- /dev/null
@@ -0,0 +1,5 @@
+=== mapping with double key
+--- yaml
+foo: 1
+foo: 2
+--- warning: E_DUPKEY
index 0db6fe3..7fbbbba 100644 (file)
@@ -120,6 +120,10 @@ L<CPAN::Meta::Requirements> has been upgraded from version 2.132 to 2.133.
 
 =item *
 
+L<CPAN::Meta::YAML> has been upgraded from version 0.014 to 0.016.
+
+=item *
+
 L<Math::BigInt> has been upgraded from version 1.9997 to 1.999701.
 
 Correct the behaviour of bdiv() and bmod() in list context. [perl #124300]