Debian Codegraph @

cpan/Test2-Suite/t/modules/Require/RealFork.t

raw
1 use strict;
2 use warnings;
3
4 # Prevent Test2::Util from making 'CAN_REALLY_FORK' a constant
5 my $forks;
6 BEGIN {
7 require Test2::Util;
8 local $SIG{__WARN__} = sub { 1 }; # no warnings is not sufficient on older perls
9 *Test2::Util::CAN_REALLY_FORK = sub { $forks };
10 }
11
12 use Test2::Bundle::Extended -target => 'Test2::Require::RealFork';
13
14 {
15 $forks = 0;
16 is($CLASS->skip(), 'This test requires a perl capable of true forking.', "will skip");
17
18 $forks = 1;
19 is($CLASS->skip(), undef, "will not skip");
20 }
21
22 done_testing;