Commit 44d03de 1 parent a8c62e5 commit 44d03de Copy full SHA for 44d03de
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ is( $class, 'PerlPowerTools::rm' );
11
11
my $dir = File::Temp::tempdir( CLEANUP => 1 );
12
12
chdir $dir or BAIL_OUT( " Could not change to $dir : $! " );
13
13
14
+ my $EXIT ;
15
+ BEGIN {
16
+ *CORE::GLOBAL::exit = sub { $EXIT = $_ [0] };
17
+ }
14
18
15
19
# These are the elements in each row of the table
16
20
my $n ; BEGIN { $n = 0 }
@@ -163,12 +167,8 @@ subtest 'table' => sub {
163
167
my $error = ' ' ;
164
168
open my $error_fh , ' >:utf8' , \$error ;
165
169
166
- my $exit = do {
167
- no warnings qw( once redefine) ;
168
- local *PerlPowerTools::rm::exit = sub { return $_ [1] };
169
- $class -> run( args => \@run_args , error_fh => $error_fh );
170
- };
171
- is $exit , $row -> [EXIT], " Exit code is " . $row -> [EXIT];
170
+ $class -> run( args => \@run_args , error_fh => $error_fh );
171
+ is $EXIT , $row -> [EXIT], " Exit code is " . $row -> [EXIT];
172
172
173
173
subtest ' what remains' => sub {
174
174
pass() if @{ $row -> [REMAINS] } == 0;
You can’t perform that action at this time.
0 commit comments