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.7 by root, Fri Aug 12 18:41:28 2011 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines