Skip to content

Commit f153dc5

Browse files
committed
Add tests for RT #127101
1 parent a8bbde8 commit f153dc5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

S17-promise/allof.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 12;
4+
plan 13;
55

66
{
77
my $p1 = Promise.new;
@@ -51,4 +51,10 @@ plan 12;
5151
ok (await Promise.allof($job1, $job2)), "start + await + allof combo, RT #122802";
5252
}
5353

54+
# RT #127101
55+
{
56+
my $p = Promise.allof(my @promises);
57+
is $p.status, Kept, 'an empty list should give a kept Promise';
58+
}
59+
5460
throws-like { Promise.allof(42) }, X::Promise::Combinator;

S17-promise/anyof.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 9;
4+
plan 10;
55

66
{
77
my $p1 = Promise.new;
@@ -31,4 +31,10 @@ plan 9;
3131
is $pany.status, Kept, "Other promise keeping doesn't affect status";
3232
}
3333

34+
# RT #127101
35+
{
36+
my $p = Promise.anyof(my @promises);
37+
is $p.status, Kept, 'an empty list should give a kept Promise';
38+
}
39+
3440
throws-like { Promise.anyof(42) }, X::Promise::Combinator;

0 commit comments

Comments
 (0)