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.2 by root, Wed Mar 28 23:11:16 2012 UTC vs.
Revision 1.4 by root, Wed Mar 28 23:45:47 2012 UTC

1#! perl 1#! perl
2 2
3$| = 1; 3$| = 1;
4 4
5BEGIN { 5BEGIN {
6 print "1..31\n"; 6 print "1..35\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 {
56print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n"; 56print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n";
57 57
58t 1, rename => "$DIR/test", "$DIR/test2"; 58t 1, rename => "$DIR/test", "$DIR/test2";
59 59
60############################################################################# 60#############################################################################
61# test dir
62
63t 0, readdir => "$DIR/nonexistent";
64my $res = t 1, readdir => $DIR;
65print @$res != 1 ? "not " : "", "ok ", $t++, " # res count\n";
66print $res->[0] ne "test2" ? "not " : "", "ok ", $t++, " # res data (@$res)\n";
67
68#############################################################################
61# test file 69# test file
62 70
63$fh = t 1, open => "$DIR/test2", O_RDONLY, 0; 71$fh = t 1, open => "$DIR/test2", O_RDONLY, 0;
64 72
65print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n"; 73print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines