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
88431378
RGS
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
1ae3d757 14require "./test.pl";
88431378
RGS
15
16#
17# Format: [Module-that-should-not-be-loaded => modules to test]
18#
88431378 19
0ef88544
NC
20foreach my $test ([Carp => qw(warnings Exporter)],
21 ) {
88431378
RGS
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 --
20e5bab4 29 fresh_perl_is ($prog, "ok", {}, "$module does not load $exclude");
88431378
RGS
30 }
31}
32
0ef88544 33done_testing();