Debian Codegraph @

ext/XS-APItest/t/check_warnings.t

raw
1 #!perl
2
3 # This test checks to make sure that a BEGIN block created from an XS call
4 # does not implicitly change the current warning scope, causing a CHECK
5 # or INIT block created after the corresponding phase to warn when it
6 # shouldn’t.
7
8 use Test::More tests => 1;
9
10 $SIG{__WARN__} = sub { $w .= shift };
11
12 use warnings;
13 eval q|
14 BEGIN{
15 no warnings;
16 package XS::APItest; require XSLoader; XSLoader::load()
17 }
18 |;
19
20 is $w, undef, 'No warnings about CHECK and INIT in warningless scope';