Alien-TDLib
view release on metacpan or search on metacpan
t/06_resolve.t view on Meta::CPAN
is($P->($meta, $spec->('1.8.65'))->{npm}, '0.1008065.0', 'a version resolves via its td- dist-tag');
is($P->($meta, $spec->('1.8.64'))->{npm}, '0.1008064.0', 'a version with no dist-tag is found by scanning');
is($P->($meta, $spec->('b' x 40))->{version}, '1.8.65', 'a published commit maps back to its release');
my $unpublished = $P->($meta, $spec->('f' x 40));
is($unpublished->{commit}, 'f' x 40, 'an unpublished commit is still usable');
is($unpublished->{npm}, undef, 'an unpublished commit has no prebuilt package');
is($P->($meta, $spec->('9.9.9')), undef, 'an unknown version resolves to nothing');
# a release the registry lists without provenance must not be selected
my $no_prov = { 'dist-tags' => { latest => '0.1' }, versions => { '0.1' => {} } };
is($P->($no_prov, $spec->(undef)), undef, 'a release without tdlib provenance is refused');
# --- fallback --------------------------------------------------------------
my $fb = Alien::TDLib::Resolve::fallback();
ok($fb->{fallback}, 'the fallback is flagged as such');
is($fb->{version}, $Alien::TDLib::Resolve::FALLBACK_VERSION, 'fallback reports its version');
like($fb->{commit}, qr/^[0-9a-f]{40}$/, 'fallback carries a real commit');
( run in 2.012 seconds using v1.01-cache-2.11-cpan-e623d60df62 )