Debian Codegraph @

t/zzz-check-breaks.t

raw
1 use strict;
2 use warnings;
3
4 # this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.020
5
6 use Test::More tests => 2;
7 use Term::ANSIColor 'colored';
8
9 SKIP: {
10 skip 'no conflicts module found to check against', 1;
11 }
12
13 # this data duplicates x_breaks in META.json
14 my $breaks = {
15 "JSON::Schema::Modern::Document::OpenAPI" => "< 0.097",
16 "JSON::Schema::Modern::Vocabulary::OpenAPI" => "< 0.080",
17 "Mojolicious::Plugin::OpenAPI::Modern" => "< 0.014",
18 "OpenAPI::Modern" => "< 0.077",
19 "Test::Mojo::Role::OpenAPI::Modern" => "< 0.007"
20 };
21
22 use CPAN::Meta::Requirements;
23 use CPAN::Meta::Check 0.011;
24
25 my $reqs = CPAN::Meta::Requirements->new;
26 $reqs->add_string_requirement($_, $breaks->{$_}) foreach keys %$breaks;
27
28 our $result = CPAN::Meta::Check::check_requirements($reqs, 'conflicts');
29
30 if (my @breaks = grep defined $result->{$_}, keys %$result) {
31 diag colored('Breakages found with JSON-Schema-Modern:', 'yellow');
32 diag colored("$result->{$_}", 'yellow') for sort @breaks;
33 diag "\n", colored('You should now update these modules!', 'yellow');
34 }
35
36 pass 'checked x_breaks data';