X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=t%2F12-maps-version.t;h=da28c3286c320440993341d378437e98ebe32878;hp=13586ce54aff64caa570b42d036bab9ee6939492;hb=b43c3fc0fe6291fc7aa4c97c48fe0e29d312c071;hpb=3a6840c4ec1f85e05975608542b33a53eacbfac1 diff --git a/t/12-maps-version.t b/t/12-maps-version.t index 13586ce..da28c32 100644 --- a/t/12-maps-version.t +++ b/t/12-maps-version.t @@ -3,22 +3,39 @@ use strict; use warnings; -use Test::More tests => 10 + 7; +use Test::More tests => 11 + 2 * 5 + 7; use CPANPLUS::Dist::Gentoo::Maps; -*vc2g = \&CPANPLUS::Dist::Gentoo::Maps::version_c2g; +*vc2g = sub { + unshift @_, undef if @_ == 1; + goto &CPANPLUS::Dist::Gentoo::Maps::version_c2g +}; is vc2g('1'), '1', "version_c2g('1')"; -is vc2g('a1b'), '1', "version_c2g('a1b')"; +is vc2g('v1'), '1', "version_c2g('v1')"; is vc2g('..1'), '1', "version_c2g('..1')"; is vc2g('1.0'), '1.0', "version_c2g('1.0')"; +is vc2g('v1.0'), '1.0', "version_c2g('v1.0')"; is vc2g('1._0'), '1.0', "version_c2g('1._0')"; is vc2g('1_1'), '1_p1', "version_c2g('1_1')"; is vc2g('1_.1'), '1_p1', "version_c2g('1_.1')"; is vc2g('1_.1._2'), '1_p1.2', "version_c2g('1_.1._2')"; -is vc2g('1_.1_2'), '1_p1.2', "version_c2g('1_.1_2')"; -is vc2g('1_.1_.2'), '1_p1.2', "version_c2g('1_.1_.2')"; +is vc2g('1_.1_2'), '1_p12', "version_c2g('1_.1_2')"; +is vc2g('1_.1_.2'), '1_p12', "version_c2g('1_.1_.2')"; + +for my $test ([ '0.12' => '0.12' ], [ '0.1234' => '0.12.34' ]) { + my @dists = qw/ + ExtUtils-CBuilder + ExtUtils-ParseXS + Module-Build + Time-HiRes + Time-Local + /; + for my $dist (@dists) { + is vc2g($dist, $test->[0]), $test->[1], "'version_c2g('$dist', '$test->[0]')"; + } +} *pvc2g = \&CPANPLUS::Dist::Gentoo::Maps::perl_version_c2g;