Skip to content

Commit dc35ac7

Browse files
authored
Merge pull request #44 from okurz/fix/tidy
Apply current perl tidy rules as of 20211213
2 parents 05e7891 + 29c5575 commit dc35ac7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

t/01_run.t

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,17 +613,23 @@ subtest 'execute exeption handling' => sub {
613613
};
614614

615615
subtest 'SIG_CHLD handler in spawned process' => sub {
616-
my $simple_rwp = "$FindBin::Bin/data/simple_rwp.pl";
616+
my $simple_rwp = "$FindBin::Bin/data/simple_rwp.pl";
617617
my $sigchld_handler = "$FindBin::Bin/data/sigchld_handler.pl";
618618

619619
# use `perl <script>` here, as Github ci action place the used perl executable
620620
# somewhere like /opt/hostedtoolcache/perl/<version>/<arch>/bin/perl so
621621
# /usr/bin/perl wouldn't have all needed dependencies
622-
is( process(execute => 'perl')->args([$simple_rwp])->start()->wait_stop()->exit_status(), 0, 'simple_rwp.pl exit with 0');
622+
is(
623+
process(execute => 'perl')->args([$simple_rwp])->start()->wait_stop()
624+
->exit_status(),
625+
0,
626+
'simple_rwp.pl exit with 0'
627+
);
623628

624629
my $p = process(execute => $sigchld_handler);
625-
is( $p->start()->wait_stop()->exit_status(), 0, 'sigchld_handler.pl exit with 0');
626-
like( $p->read_all_stdout, qr/SIG_CHLD/, "SIG_CHLD handler was executed");
630+
is($p->start()->wait_stop()->exit_status(),
631+
0, 'sigchld_handler.pl exit with 0');
632+
like($p->read_all_stdout, qr/SIG_CHLD/, "SIG_CHLD handler was executed");
627633
};
628634

629635
done_testing;

t/data/sigchld_handler.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
my $collected_pid = -1;
77
$SIG{CHLD} = sub {
8-
$collected_pid = waitpid(-1, 0);
9-
print "SIG_CHLD $collected_pid exit:" . ( $?>>8) . "\n";
8+
$collected_pid = waitpid(-1, 0);
9+
print "SIG_CHLD $collected_pid exit:" . ($? >> 8) . "\n";
1010
};
1111

1212
my $pid = fork();
@@ -15,6 +15,6 @@
1515
exit 0;
1616
}
1717
print "Forked child is $pid\n";
18-
sleep 0.1 while($collected_pid != $pid);
18+
sleep 0.1 while ($collected_pid != $pid);
1919
print "Exit graceful\n";
2020
exit 0;

0 commit comments

Comments
 (0)