X7ROOT File Manager
Current Path:
/usr/share/doc/perl-CPAN-Meta/t
usr
/
share
/
doc
/
perl-CPAN-Meta
/
t
/
📁
..
📄
00-report-prereqs.dd
(7.88 KB)
📄
00-report-prereqs.t
(5.46 KB)
📄
README-data.txt
(622 B)
📄
converter-bad.t
(2.72 KB)
📄
converter-fail.t
(1.16 KB)
📄
converter-fragments.t
(4 KB)
📄
converter.t
(10.42 KB)
📁
data-fail
📁
data-fixable
📁
data-test
📁
data-valid
📁
lib
📄
load-bad.t
(805 B)
📄
merge.t
(5.74 KB)
📄
meta-obj.t
(6.62 KB)
📄
no-index.t
(1.82 KB)
📄
optional_feature-merge.t
(3.2 KB)
📁
parse-cpan-meta
📄
prereqs-finalize.t
(2.24 KB)
📄
prereqs-merge.t
(2.37 KB)
📄
prereqs.t
(3.65 KB)
📄
repository.t
(4.39 KB)
📄
save-load.t
(3.67 KB)
📄
validator.t
(1.2 KB)
Editing: converter-fragments.t
use strict; use warnings; use Test::More 0.88; use CPAN::Meta::Converter; delete $ENV{PERL_YAML_BACKEND}; delete $ENV{PERL_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_BACKEND}; delete $ENV{CPAN_META_JSON_DECODER}; my $spec2 = { version => '2', url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', }; my @cases = ( #<<< No perltidy { label => "v1.4 requires -> v2 prereqs", from => "1.4", to => "2", input => { requires => { 'File::Spec' => "0.80", }, }, expect => { 'meta-spec' => $spec2, prereqs => { runtime => { requires => { 'File::Spec' => "0.80", }, } } }, }, { label => "v1.4 x_custom -> v2 x_custom", from => "1.4", to => "2", input => { x_authority => 'DAGOLDEN', }, expect => { 'meta-spec' => $spec2, x_authority => 'DAGOLDEN', }, }, { label => "meta-spec included", to => "2", input => { 'meta-spec' => { version => '1.0' }, requires => { 'File::Spec' => "0.80", }, }, expect => { 'meta-spec' => $spec2, prereqs => { runtime => { requires => { 'File::Spec' => "0.80", }, } } }, }, { # this is a test of default version and intentionally gives bad # data that will get dropped by the conversion label => "default version", from => "2", to => "2", input => { requires => { 'File::Spec' => "0.80", }, }, expect => { 'meta-spec' => $spec2, }, }, { # fields deprecated from older versions label => "v1.4 prereq stuff -> v2 prereqs", from => "1.4", to => "2", input => { configure_requires => { 'File::Spec' => "0.80", }, build_requires => { 'Scalar::Util' => '1.0', }, requires => { 'B' => '3.1', }, recommends => { 'Config' => '4.0', }, conflicts => { 'File::Temp' => "0.2", }, }, expect => { 'meta-spec' => $spec2, prereqs => { configure => { requires => { 'File::Spec' => "0.80", }, }, build => { requires => { 'Scalar::Util' => '1.0', }, }, runtime => { conflicts => { 'File::Temp' => "0.2", }, requires => { 'B' => '3.1', }, recommends => { 'Config' => '4.0', }, }, }, }, }, { label => "v1.1 license_url: -> v2 license", from => "1.1", to => "2", input => { license_url => 'http://opensource.org/licenses/Artistic-1.0', license => 'perl', }, expect => { 'meta-spec' => $spec2, license => [ 'perl_5' ], }, }, ); for my $c (@cases) { my $cmc = CPAN::Meta::Converter->new( $c->{input}, $c->{from} ? (default_version => $c->{from} ) : () ); my $got = $cmc->upgrade_fragment; my $exp = $c->{expect}; is_deeply( $got, $exp, $c->{label} ) or diag "GOT:\n", explain($got), "EXPECTED:\n", explain($exp); } done_testing; # vim: ts=8 sts=4 sw=4 et :
Upload File
Create Folder