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
},
'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},
],
},
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
#####################################################################
}
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?
=head1 VERSION
-version 0.014
+version 0.016
=head1 SYNOPSIS
'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',
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
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
test_perl_to_yaml
test_dump_error
test_load_error
+ test_load_warning
test_yaml_json
test_code_point
error_like
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},
);
$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;
}
#--------------------------------------------------------------------------#
+# 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
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,
\--- foo
a: 1
--- error: E_CLASSIFY
-
-=== mapping with double key
---- yaml
-foo: 1
-foo: 2
---- error: E_DUPKEY
--- /dev/null
+=== mapping with double key
+--- yaml
+foo: 1
+foo: 2
+--- warning: E_DUPKEY
=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]