1 | #! perl |
1 | #! perl |
2 | |
2 | |
3 | $| = 1; |
3 | $| = 1; |
4 | |
4 | |
5 | BEGIN { |
5 | BEGIN { |
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 | } |
9 | use AnyEvent; |
9 | use AnyEvent; |
10 | use AnyEvent::IO qw(:DEFAULT :flags); |
10 | use AnyEvent::IO qw(:DEFAULT :flags); |
11 | BEGIN { |
11 | BEGIN { |
… | |
… | |
56 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n"; |
56 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n"; |
57 | |
57 | |
58 | t 1, rename => "$DIR/test", "$DIR/test2"; |
58 | t 1, rename => "$DIR/test", "$DIR/test2"; |
59 | |
59 | |
60 | ############################################################################# |
60 | ############################################################################# |
|
|
61 | # test dir |
|
|
62 | |
|
|
63 | t 0, readdir => "$DIR/nonexistent"; |
|
|
64 | my $res = t 1, readdir => $DIR; |
|
|
65 | print @$res != 1 ? "not " : "", "ok ", $t++, " # res count\n"; |
|
|
66 | print $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 | |
65 | print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n"; |
73 | print +(t 1, read => $fh, 6) ne "test1t" ? "not " : "", "ok ", $t++, " # read 6\n"; |