ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/t/09_timer.t
(Generate patch)

Comparing Coro/t/09_timer.t (file contents):
Revision 1.1 by root, Sun Nov 25 20:04:06 2001 UTC vs.
Revision 1.4 by root, Fri Nov 24 15:34:33 2006 UTC

1$|=1; 1$|=1;
2print "1..6\n"; 2print "1..4\n";
3 3
4use Coro; 4use Coro;
5use Coro::Signal;
5use Coro::Timer; 6use Coro::Timer;
6 7
7print "ok 1\n"; 8print "ok 1\n";
8 9
9new Coro::Timer after => 0, cb => sub { 10my $signal = new Coro::Signal;
10 print "ok 2\n";
11};
12new Coro::Timer after => 1, cb => sub {
13 print "ok 4\n";
14};
15new Coro::Timer after => 0, cb => sub {
16 print "ok 3\n";
17};
18(new Coro::Timer after => 0, cb => sub {
19 print "not ok 4\n";
20})->cancel;
21new Coro::Timer at => time + 2, cb => sub {
22 print "ok 5\n";
23 $Coro::main->ready;
24};
25 11
26schedule; 12my $timeout = Coro::Timer::timeout 3;
27print "ok 6\n"; 13
14print $signal->timed_wait(1) ? "not ok" : "ok", " 2\n";
15
16print $timeout ? "not ok" : "ok", " 3\n";
17
18Coro::Timer::sleep 2;
19
20print $timeout ? "ok" : "not ok", " 4\n";
21

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines