File tree 1 file changed +7
-9
lines changed
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -304,15 +304,13 @@ sub command_exit_is
304
304
my $h = start $cmd ;
305
305
$h -> finish();
306
306
307
- # On Windows, the exit status of the process is returned directly as the
308
- # process's exit code, while on Unix, it's returned in the high bits
309
- # of the exit code (see WEXITSTATUS macro in the standard <sys/wait.h>
310
- # header file). IPC::Run's result function always returns exit code >> 8,
311
- # assuming the Unix convention, which will always return 0 on Windows as
312
- # long as the process was not terminated by an exception. To work around
313
- # that, use $h->full_result on Windows instead.
314
- my $result = ($Config {osname } eq " MSWin32" ) ?
315
- ($h -> full_results)[0] : $h -> result(0);
307
+ # Normally, if the child called exit(N), IPC::Run::result() returns N. On
308
+ # Windows, with IPC::Run v20220807.0 and earlier, full_results() is the
309
+ # method that returns N (https://github.com/toddr/IPC-Run/issues/161).
310
+ my $result =
311
+ ($Config {osname } eq " MSWin32" && $IPC::Run::VERSION <= 20220807.0)
312
+ ? ($h -> full_results)[0]
313
+ : $h -> result(0);
316
314
is($result , $expected , $test_name );
317
315
}
318
316
You can’t perform that action at this time.
0 commit comments