ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/handle/01_readline.t
(Generate patch)

Comparing AnyEvent/t/handle/01_readline.t (file contents):
Revision 1.10 by root, Fri Jun 6 11:00:32 2008 UTC vs.
Revision 1.12 by root, Thu Aug 21 23:48:35 2008 UTC

1#!perl 1#!perl
2
3# actually tests a few other read/write types as well
2 4
3use strict; 5use strict;
4 6
5use AnyEvent::Impl::Perl; 7use AnyEvent::Impl::Perl;
6use AnyEvent::Handle; 8use AnyEvent::Handle;
7use Test::More tests => 8; 9use Test::More tests => 8;
8use Socket; 10use Socket;
11use Errno;
9 12
10{ 13{
11 my $cv = AnyEvent->condvar; 14 my $cv = AnyEvent->condvar;
12 15
13 socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC; 16 socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC;
14 17
15 my $rd_ae = AnyEvent::Handle->new ( 18 my $rd_ae = AnyEvent::Handle->new (
16 fh => $rd, 19 fh => $rd,
17 on_error => sub { 20 on_error => sub {
18 ok ($! == Errno::EPIPE); 21 ok ($! == &Errno::EPIPE);
22 $cv->broadcast;
19 }, 23 },
20 on_eof => sub { $cv->broadcast }, 24 on_eof => sub {
25 ok (0, "got eof");
26 },
21 ); 27 );
22 28
23 my $concat; 29 my $concat;
24 30
25 $rd_ae->push_read (line => sub { 31 $rd_ae->push_read (line => sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines