diff options
author | Todd Rinaldo <toddr@cpan.org> | 2017-09-13 14:35:39 -0500 |
---|---|---|
committer | Todd Rinaldo <toddr@cpanel.net> | 2017-11-08 16:36:16 -0600 |
commit | 06c80a59fc8f550b6c69d04e2fc00578b4e80d59 (patch) | |
tree | 1313b3f6d1b64d083e057946d2c52f6dd28050b0 /ext/B | |
parent | 288fb12fea899ab55b00d9f867f6343e251f8da8 (diff) | |
download | perl-06c80a59fc8f550b6c69d04e2fc00578b4e80d59.tar.gz |
ext/B/t/strict.t: Assure B.pm and O.pm pass strict and warnings checks.
We need to test these in unit tests since they do not load these modules to
prevent pollution of the stash in compilers.
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/t/strict.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/B/t/strict.t b/ext/B/t/strict.t new file mode 100644 index 0000000000..4d1b84aa20 --- /dev/null +++ b/ext/B/t/strict.t @@ -0,0 +1,30 @@ +#!./perl -w + +use strict; +use warnings; + +use Config; +use Test::More; + +BEGIN { + if ( ( $Config{'extensions'} !~ /\sB\s/ ) ) { + plan skip_all => "Perl was not compiled with B"; + exit 0; + } +} + +use strict; +use warnings; + +use B (); +use O (); + +foreach my $module (qw/B O/) { + my $path = $INC{ $module . '.pm' }; + my $check = "$^X -cw -Mstrict $path 2>&1"; + my $got = `$check`; + is( $got, "$path syntax OK\n", "$module.pm compiles without errors" ) + or diag($got); +} + +done_testing(); |