Debian Codegraph @

t/Catmandu-Fix-Condition-all_match.t

raw symbols SCIP
1 #!/usr/bin/env perl
2
3 use strictscip-perl cpan Catmandu 1.2025 strict/;
4 use warningsscip-perl cpan Catmandu 1.2025 warnings/;
5 use Test::Morescip-perl cpan Catmandu 1.2025 Test/More/;
6 use Catmandu::Fix::set_fieldscip-perl cpan Catmandu 1.2025 Catmandu/Fix/set_field/;
7
8 my $pkg;
9
10 BEGIN {
11 $pkg = 'Catmandu::Fix::Condition::all_match';
12 use_okscip-perl cpan Catmandu 1.2025 main/use_ok(). $pkg;
13 }
14
15 {
16 my $cond = $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('foo', 'abc');
17 $cond->pass_fixesscip-perl cpan Catmandu 1.2025 main/pass_fixes().([Catmandu::Fix::set_field->newscip-perl cpan Catmandu 1.2025 Catmandu/Fix/set_field/new().('test', 'pass')]);
18 $cond->fail_fixesscip-perl cpan Catmandu 1.2025 main/fail_fixes().([Catmandu::Fix::set_field->newscip-perl cpan Catmandu 1.2025 Catmandu/Fix/set_field/new().('test', 'fail')]);
19
20 is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $cond->fixscip-perl cpan Catmandu 1.2025 main/fix().({foo => qw(abc)}), {foo => qw(abc), test => 'pass'};
21
22 is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $cond->fixscip-perl cpan Catmandu 1.2025 main/fix().({foo => qw(cbc)}), {foo => qw(cbc), test => 'fail'};
23 }
24
25 {
26 my $cond = $pkg->newscip-perl cpan Catmandu 1.2025 main/new().('foo.*', 'abc');
27 $cond->pass_fixesscip-perl cpan Catmandu 1.2025 main/pass_fixes().([Catmandu::Fix::set_field->newscip-perl cpan Catmandu 1.2025 Catmandu/Fix/set_field/new().('test', 'pass')]);
28 $cond->fail_fixesscip-perl cpan Catmandu 1.2025 main/fail_fixes().([Catmandu::Fix::set_field->newscip-perl cpan Catmandu 1.2025 Catmandu/Fix/set_field/new().('test', 'fail')]);
29
30 is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $cond->fixscip-perl cpan Catmandu 1.2025 main/fix().({foo => [qw(abc)]}),
31 {foo => [qw(abc)], test => 'pass'};
32
33 is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $cond->fixscip-perl cpan Catmandu 1.2025 main/fix().({foo => [qw(abc abc)]}),
34 {foo => [qw(abc abc)], test => 'pass'};
35
36 is_deeplyscip-perl cpan Catmandu 1.2025 main/is_deeply(). $cond->fixscip-perl cpan Catmandu 1.2025 main/fix().({foo => [qw(abc cbc)]}),
37 {foo => [qw(abc cbc)], test => 'fail'};
38 }
39
40 done_testing 6;