diff --git a/S17-promise/allof.t b/S17-promise/allof.t index 45e887f3d2..5d097199ef 100644 --- a/S17-promise/allof.t +++ b/S17-promise/allof.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 12; +plan 13; { my $p1 = Promise.new; @@ -51,4 +51,10 @@ plan 12; ok (await Promise.allof($job1, $job2)), "start + await + allof combo, RT #122802"; } +# RT #127101 +{ + my $p = Promise.allof(my @promises); + is $p.status, Kept, 'an empty list should give a kept Promise'; +} + throws-like { Promise.allof(42) }, X::Promise::Combinator; diff --git a/S17-promise/anyof.t b/S17-promise/anyof.t index 75647f8e5f..fec1b4cd29 100644 --- a/S17-promise/anyof.t +++ b/S17-promise/anyof.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 9; +plan 10; { my $p1 = Promise.new; @@ -31,4 +31,10 @@ plan 9; is $pany.status, Kept, "Other promise keeping doesn't affect status"; } +# RT #127101 +{ + my $p = Promise.anyof(my @promises); + is $p.status, Kept, 'an empty list should give a kept Promise'; +} + throws-like { Promise.anyof(42) }, X::Promise::Combinator;