Server IP : 92.204.138.22 / Your IP : 3.135.188.194 Web Server : Apache System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64 User : internationaljou ( 1019) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/proc/thread-self/root/usr/share/doc/perl-CPAN-Meta/t/ |
Upload File : |
use strict; use warnings; use Test::More 0.88; use CPAN::Meta; use CPAN::Meta::Validator; use CPAN::Meta::Converter; use File::Spec; use IO::Dir; use Parse::CPAN::Meta; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my $data_dir = IO::Dir->new( 't/data-fail' ); my @files = sort grep { /^\w/ } $data_dir->read; *_spec_version = \&CPAN::Meta::Converter::_extract_spec_version; use Data::Dumper; for my $f ( reverse sort @files ) { my $path = File::Spec->catfile('t','data-fail',$f); my $original = Parse::CPAN::Meta->load_file( $path ); ok( $original, "loaded invalid $f" ); my $original_v = _spec_version($original); # UPCONVERSION if ( $original_v lt '2' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $fixed = eval { $cmc->convert( version => 2 ) }; ok ( $@, "error thrown up converting" ); } # DOWNCONVERSION if ( $original_v gt '1.0' ) { my $cmc = CPAN::Meta::Converter->new( $original ); my $fixed = eval { $cmc->convert( version => '1.0' ) }; ok ( $@, "error thrown down converting" ); } } done_testing; # vim: ts=2 sts=2 sw=2 et :