Skip to content

Commit 249d9ba

Browse files
committed
Promise.has_result -> Promise.bool as per new spec
1 parent 3bbc393 commit 249d9ba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

S17-concurrency/promise.t

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ plan 58;
66
{
77
my $p = Promise.new;
88
is $p.status, Planned, "Newly created Promise has Planned status";
9-
nok $p.has_result, "Newly created Promise has now result yet";
9+
nok $p.Bool, "Newly created Promise has now result yet";
1010
nok ?$p, "Newly created Promise is false";
1111
dies_ok { $p.cause }, "Cannot call cause on a Planned Promise";
1212

1313
$p.keep("kittens");
1414
is $p.status, Kept, "Kept Promise has Kept status";
15-
ok $p.has_result, "Kept Promise has a result";
15+
ok $p.Bool, "Kept Promise has a result";
1616
ok ?$p, "Kept Promise is true";
1717
is $p.result, "kittens", "Correct result";
1818

@@ -25,7 +25,7 @@ plan 58;
2525
my $p = Promise.new;
2626
$p.break("glass");
2727
is $p.status, Broken, "Broken Promise has Broken status";
28-
ok $p.has_result, "Broken Promise has a result";
28+
ok $p.Bool, "Broken Promise has a result";
2929
ok ?$p, "Broken Promise is true";
3030
isa_ok $p.cause, Exception, "cause returns an exception";
3131
is $p.cause.message, "glass", "Correct message";
@@ -110,7 +110,7 @@ plan 58;
110110
my $p2 = Promise.new;
111111
my $pany = Promise.anyof($p1, $p2);
112112
isa_ok $pany, Promise, "anyof returns a Promise";
113-
nok $pany.has_result, "No result yet";
113+
nok $pany.Bool, "No result yet";
114114

115115
$p1.keep(1);
116116
is $pany.result, True, "result is true";
@@ -139,10 +139,10 @@ plan 58;
139139
my $p2 = Promise.new;
140140
my $pall = Promise.allof($p1, $p2);
141141
isa_ok $pall, Promise, "allof returns a Promise";
142-
nok $pall.has_result, "No result yet";
142+
nok $pall.Bool, "No result yet";
143143

144144
$p1.keep(1);
145-
nok $pall.has_result, "Still not kept";
145+
nok $pall.Bool, "Still not kept";
146146

147147
$p2.keep(1);
148148
is $pall.result, True, "result is true after both kept";

0 commit comments

Comments
 (0)