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

Comparing AnyEvent/t/io_common (file contents):
Revision 1.1 by root, Wed Mar 28 22:28:48 2012 UTC vs.
Revision 1.2 by root, Wed Mar 28 23:11:16 2012 UTC

1#! perl 1#! perl
2 2
3$| = 1; 3$| = 1;
4 4
5BEGIN { 5BEGIN {
6 print "1..24\n"; 6 print "1..31\n";
7 print "ok 1 # MODEL=$AnyEvent::IO::MODEL\n"; 7 print "ok 1 # MODEL=$AnyEvent::IO::MODEL\n";
8} 8}
9use AnyEvent; 9use AnyEvent;
10use AnyEvent::IO qw(:DEFAULT :flags); 10use AnyEvent::IO qw(:DEFAULT :flags);
11BEGIN { 11BEGIN {
13} 13}
14 14
15our $t = 3; 15our $t = 3;
16 16
17sub t { 17sub t {
18 my $cv = AE::cv;
19 my $ok = shift; 18 my $ok = shift;
20 my $f = "ae_" . shift; 19 my $f = "ae_" . shift;
21 $f->(@_, my $cv = AE::cv); 20 $f->(@_, my $cv = AE::cv);
22 my @res = $cv->recv; 21 my @res = $cv->recv;
23 22
59t 1, rename => "$DIR/test", "$DIR/test2"; 58t 1, rename => "$DIR/test", "$DIR/test2";
60 59
61############################################################################# 60#############################################################################
62# test file 61# test file
63 62
64my $fh = t 1, open => "$DIR/test2", O_RDONLY, 0; 63$fh = t 1, open => "$DIR/test2", O_RDONLY, 0;
65 64
66print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n"; 65print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n";
67print +(t 1, read => $fh, 7) ne "est2" ? "not " : "", "ok ", $t++, " # read 7\n"; 66print +(t 1, read => $fh, 7) ne "est2" ? "not " : "", "ok ", $t++, " # read 7\n";
68print +(t 1, read => $fh, 8) ne "" ? "not " : "", "ok ", $t++, " # read 8\n"; 67print +(t 1, read => $fh, 8) ne "" ? "not " : "", "ok ", $t++, " # read 8\n";
69 68

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines