Skip to content

Commit fbfe061

Browse files
committed
Fix a test on Windows; avoid a warning.
1 parent e8f675d commit fbfe061

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

S17-procasync/basic.t

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ use Test;
44

55
plan 9;
66

7-
my $pc = Proc::Async.new( 'echo', <Hello World> );
7+
my $pc = $*DISTRO.is-win
8+
?? Proc::Async.new( 'cmd', </c echo Hello World> )
9+
!! Proc::Async.new( 'echo', <Hello World> );
810
isa_ok $pc, Proc::Async;
911

1012
my $so = $pc.stdout;
1113
cmp_ok $so, '~~', Supply;
1214
my $se = $pc.stderr;
1315
cmp_ok $se, '~~', Supply;
1416

15-
my $stdout;
16-
my $stderr;
17-
$so.act: { $stdout ~= $_ };
18-
$se.act: { $stderr ~= $_ };
17+
my $stdout = "";
18+
my $stderr = "";
19+
$so.act: { $stdout ~= $_.subst("\r", "", :g) };
20+
$se.act: { $stderr ~= $_.subst("\r", "", :g) };
1921

2022
my $pm = $pc.start;
2123
isa_ok $pm, Promise;

0 commit comments

Comments
 (0)