Debian Codegraph @

t/app/exclude_core.t

raw
1 use strict;
2 use warnings;
3 use FindBin;
4 use lib "$FindBin::Bin/../../";
5 use Test::More;
6 use t::Util;
7
8 test_app('ignore core modules', sub {
9 my $tmpdir = shift;
10
11 test_file("$tmpdir/MyTest.pm", <<'END');
12 use strict;
13 use warnings;
14 use Foo;
15 END
16 }, {exclude_core => 1}, { runtime => { requires => { Foo => 0 }}});
17
18 test_app('do not ignore better core modules', sub {
19 my $tmpdir = shift;
20
21 test_file("$tmpdir/MyTest.pm", <<'END');
22 use strict;
23 use warnings;
24 use Exporter 5.57;
25 END
26 }, {exclude_core => 1}, { runtime => { requires => { Exporter => '5.57' }}});
27
28 test_app('ignore core modules for higher perl version', sub {
29 my $tmpdir = shift;
30
31 test_file("$tmpdir/MyTest.pm", <<'END');
32 use 5.020;
33 use strict;
34 use warnings;
35 use experimental qw/signatures/;
36 use Foo;
37 END
38 }, {exclude_core => 1}, { runtime => { requires => { Foo => 0, perl => '5.020' }}});
39
40 test_app('ignore core modules with undef version', sub {
41 my $tmpdir = shift;
42
43 test_file("$tmpdir/MyTest.pm", <<'END');
44 use strict;
45 use warnings;
46 use Foo;
47 END
48 }, {exclude_core => 1, perl_version => 5.006}, { runtime => { requires => { Foo => 0 }}});
49
50 done_testing;