3 # Tests for perl exit codes, playing with $?, etc...
11 # VMS and Windows need -e "...", most everything else works better with '
12 my $quote = $^O =~ /^(VMS|MSWin\d+)$/ ? q{"} : q{'};
14 # Run some code, return its wait status.
18 return system($cmd.$quote.$code.$quote);
21 use Test::More tests => 3;
26 is( $exit >> 8, 0, 'Normal exit' );
28 $exit = run('exit 42');
29 is( $exit >> 8, 42, 'Non-zero exit' );
31 $exit = run('END { $? = 42 }');
32 is( $exit >> 8, 42, 'Changing $? in END block' );