This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Pod::Simple from version 3.38 to 3.39
[perl5.git] / t / lib / no_load.t
... / ...
CommitLineData
1#!./perl
2#
3# Check that certain modules don't get loaded when other modules are used.
4#
5
6BEGIN {
7 chdir 't' if -d 't';
8 @INC = qw(. ../lib);
9}
10
11use strict;
12use warnings;
13
14require "./test.pl";
15
16#
17# Format: [Module-that-should-not-be-loaded => modules to test]
18#
19
20foreach my $test ([Carp => qw(warnings Exporter)],
21 ) {
22 my ($exclude, @modules) = @$test;
23
24 foreach my $module (@modules) {
25 my $prog = <<" --";
26 use $module;
27 print exists \$INC {'$exclude.pm'} ? "not ok" : "ok";
28 --
29 fresh_perl_is ($prog, "ok", {}, "$module does not load $exclude");
30 }
31}
32
33done_testing();