Skip to content

Commit

Permalink
Fix through sort.
Browse files Browse the repository at this point in the history
  • Loading branch information
twose committed Nov 24, 2018
1 parent ab5e7eb commit 7f88d78
Showing 1 changed file with 61 additions and 59 deletions.
120 changes: 61 additions & 59 deletions tests/swoole_coroutine/list_and_backtrace.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ go(function () {
$main = go(function () {
$coros = Co::listCoroutines();
Co::yield();
$coros = iterator_to_array($coros);
sort($coros);
foreach ($coros as $cid) {
var_dump($cid);
var_dump(Co::getBackTrace($cid));
Expand All @@ -36,87 +38,83 @@ go(function () {
swoole_event_wait();
?>
--EXPECTF--
int(9)
int(1)
array(1) {
[0]=>
array(6) {
array(4) {
["file"]=>
string(%d) "%s"
["line"]=>
int(25)
int(31)
["function"]=>
string(6) "resume"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
string(2) "go"
["args"]=>
array(1) {
[0]=>
int(4)
object(Closure)#2 (0) {
}
}
}
}
int(8)
int(2)
array(1) {
[0]=>
array(6) {
array(4) {
["file"]=>
string(%d) "%s"
["line"]=>
int(22)
int(30)
["function"]=>
string(11) "getaddrinfo"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
string(2) "go"
["args"]=>
array(1) {
[0]=>
string(9) "localhost"
object(Closure)#3 (0) {
}
}
}
}
int(7)
int(3)
array(1) {
[0]=>
array(6) {
array(4) {
["file"]=>
string(%d) "%s"
["line"]=>
int(19)
int(29)
["function"]=>
string(8) "readFile"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
string(2) "go"
["args"]=>
array(1) {
[0]=>
string(%d) "%s"
object(Closure)#6 (1) {
["static"]=>
array(1) {
["main"]=>
int(4)
}
}
}
}
}
int(6)
int(4)
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(16)
int(13)
["function"]=>
string(5) "sleep"
string(12) "getBackTrace"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
float(0.001)
int(4)
}
}
}
Expand All @@ -127,7 +125,7 @@ array(1) {
["file"]=>
string(%d) "%s"
["line"]=>
int(26)
int(28)
["function"]=>
string(2) "go"
["args"]=>
Expand All @@ -143,83 +141,87 @@ array(1) {
}
}
}
int(4)
int(6)
array(1) {
[0]=>
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(11)
int(18)
["function"]=>
string(12) "getBackTrace"
string(5) "sleep"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
int(4)
float(0.001)
}
}
}
int(3)
int(7)
array(1) {
[0]=>
array(4) {
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(27)
int(21)
["function"]=>
string(2) "go"
string(8) "readFile"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
object(Closure)#6 (1) {
["static"]=>
array(1) {
["main"]=>
int(4)
}
}
string(%d) "%s"
}
}
}
int(2)
int(8)
array(1) {
[0]=>
array(4) {
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(28)
int(24)
["function"]=>
string(2) "go"
string(11) "getaddrinfo"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
object(Closure)#3 (0) {
}
string(9) "localhost"
}
}
}
int(1)
int(9)
array(1) {
[0]=>
array(4) {
array(6) {
["file"]=>
string(%d) "%s"
["line"]=>
int(29)
int(27)
["function"]=>
string(2) "go"
string(6) "resume"
["class"]=>
string(16) "Swoole\Coroutine"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
object(Closure)#2 (0) {
}
int(4)
}
}
}

0 comments on commit 7f88d78

Please sign in to comment.