--- AnyEvent/t/io_common 2012/03/28 23:11:16 1.2 +++ AnyEvent/t/io_common 2012/04/04 02:18:30 1.6 @@ -3,7 +3,7 @@ $| = 1; BEGIN { - print "1..31\n"; + print "1..37\n"; print "ok 1 # MODEL=$AnyEvent::IO::MODEL\n"; } use AnyEvent; @@ -16,7 +16,7 @@ sub t { my $ok = shift; - my $f = "ae_" . shift; + my $f = "io_" . shift; $f->(@_, my $cv = AE::cv); my @res = $cv->recv; @@ -40,10 +40,13 @@ t 0, rmdir => $DIR; -t 1, write => $fh, "test1"; +t 1, write => $fh, "tes--"; t 1, write => $fh, "test2"; t 1, write => $fh, ""; +t 1, seek => $fh, 3, 0; +t 1, write => $fh, "t1"; + t 1, stat => $fh; print -s _ != 10 ? "not " : "", "ok ", $t++, " # stat size\n"; @@ -58,6 +61,14 @@ t 1, rename => "$DIR/test", "$DIR/test2"; ############################################################################# +# test dir + +t 0, readdir => "$DIR/nonexistent"; +my $res = t 1, readdir => $DIR; +print @$res != 1 ? "not " : "", "ok ", $t++, " # res count\n"; +print $res->[0] ne "test2" ? "not " : "", "ok ", $t++, " # res data (@$res)\n"; + +############################################################################# # test file $fh = t 1, open => "$DIR/test2", O_RDONLY, 0;