Skip to content

Commit fc258cb

Browse files
committed
#9: * fix coroutines tests
1 parent f5dc529 commit fc258cb

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/coroutine/006-coroutine_cancel_basic.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $coroutine = spawn(function() {
1414
$cancellation = new CancellationException("test cancellation");
1515
$coroutine->cancel($cancellation);
1616

17+
var_dump($coroutine->isCancellationRequested());
1718
var_dump($coroutine->isCancelled());
1819

1920
try {
@@ -25,4 +26,5 @@ try {
2526
?>
2627
--EXPECT--
2728
bool(true)
29+
bool(false)
2830
Caught: test cancellation

tests/coroutine/028-coroutine_state_transitions.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ echo "before cancel request - isCancelled: " . ($cancel_request_coroutine->isCan
9595
$cancel_request_coroutine->cancel(new \Async\CancellationException("Test cancellation"));
9696

9797
echo "after cancel request - isCancellationRequested: " . ($cancel_request_coroutine->isCancellationRequested() ? "true" : "false") . "\n";
98+
99+
suspend(); // Let cancellation propagate
100+
98101
echo "after cancel request - isCancelled: " . ($cancel_request_coroutine->isCancelled() ? "true" : "false") . "\n";
99102

100103
echo "end\n";

0 commit comments

Comments
 (0)