File: 08_join.t

package info (click to toggle)
libcoro-perl 6.570-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,144 kB
  • sloc: ansic: 2,560; perl: 2,122; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$|=1;
print "1..10\n";

use Coro;

print "ok 1\n";

$p1 = async {
   print "ok 3\n";
   terminate 5;
};

$p2 = async {
   print "ok 4\n";
   ()
};

$p3 = async {
   print "ok 5\n";
   (0,1,2)
};

print "ok 2\n";
print 0 == @{[$p2->join]} ? "ok " : "not ok ", "6\n";
print 0 == ($p3->join)[0] ? "ok " : "not ok ", "7\n";
print 1 == ($p3->join)[1] ? "ok " : "not ok ", "8\n";
print 2 == ($p3->join)[2] ? "ok " : "not ok ", "9\n";
print 5 == $p1->join      ? "ok " : "not ok ", "10\n";