--- AnyEvent/t/09_multi.t 2011/08/04 09:14:03 1.3 +++ AnyEvent/t/09_multi.t 2011/08/12 00:53:29 1.4 @@ -18,7 +18,7 @@ use AnyEvent::Util; BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} } -$| = 1; print "1..14\n"; +$| = 1; print "1..15\n"; print "ok 1\n"; @@ -27,7 +27,7 @@ # I/O write { my $cv = AE::cv; - my $wt = AE::timer 0.1, 0, $cv; + my $wt = AE::timer 1, 0, $cv; my $s = 0; $cv->begin; my $wa = AE::io $a, 1, sub { $cv->end; $s |= 1 }; @@ -54,7 +54,7 @@ syswrite $b, "x"; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 1, 0, $cv; $s = 0; $cv->begin; @@ -151,7 +151,22 @@ print $s == 0 ? "" : "not ", "ok 13 # $s\n"; } -print "ok 14\n"; +# timers (don't laugh, some event loops are more broken...) +{ + my $cv = AE::cv; + my $wt = AE::timer 1, 0, $cv; + my $s = 0; + + $cv->begin; my $wa = AE::timer 0 , 0, sub { $cv->end; $s |= 1 }; + $cv->begin; my $wb = AE::timer 0 , 0, sub { $cv->end; $s |= 2 }; + $cv->begin; my $wc = AE::timer 0.01, 0, sub { $cv->end; $s |= 4 }; + + $cv->recv; + + print $s == 7 ? "" : "not ", "ok 14 # $s\n"; +} + +print "ok 15\n"; exit 0;