ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/65_event_04_condvar.t
(Generate patch)

Comparing AnyEvent/t/65_event_04_condvar.t (file contents):
Revision 1.1 by root, Thu Oct 2 08:43:57 2008 UTC vs.
Revision 1.6 by root, Tue Aug 2 20:02:46 2011 UTC

1$|=1; 1use AnyEvent;
2BEGIN { 2BEGIN { eval q{use AnyEvent::Impl::Event;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::Event not loadable
3 print "1..21\n" 3}), exit 0) }
4}
5 4
6use AnyEvent; 5$| = 1; print "1..21\n";
7use AnyEvent::Impl::Event;
8 6
9print "ok 1\n"; 7print "ok 1\n";
10 8
11{ 9{
12 my $cv = AnyEvent->condvar; 10 my $cv = AnyEvent->condvar;
28 print "ok 3\n"; 26 print "ok 3\n";
29 $cv->send (7, 5); 27 $cv->send (7, 5);
30 }); 28 });
31 29
32 print "ok 2\n"; 30 print "ok 2\n";
33 $cv->wait; 31 $cv->recv;
34 print "ok 8\n"; 32 print "ok 8\n";
35 33
36 my @x = $cv->recv; 34 my @x = $cv->recv;
37 print $x[1] == 5 ? "" : "not ", "ok 9 # $x[1] == 5\n"; 35 print $x[1] == 5 ? "" : "not ", "ok 9 # $x[1] == 5\n";
38} 36}
64 62
65{ 63{
66 my $cv = AnyEvent->condvar; 64 my $cv = AnyEvent->condvar;
67 65
68 print "ok 19\n"; 66 print "ok 19\n";
69 my $t = AnyEvent->timer (after => 0, cb => sub { &$cv }); 67 my $t = AnyEvent->timer (after => 0, cb => $cv);
70 68
71 print "ok 20\n"; 69 print "ok 20\n";
72 $cv->recv; 70 $cv->recv;
73 print "ok 21\n"; 71 print "ok 21\n";
74} 72}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines