… | |
… | |
3 | $| = 1; |
3 | $| = 1; |
4 | |
4 | |
5 | # not tested: symlink, readlink, link, utime, chown, chmod |
5 | # not tested: symlink, readlink, link, utime, chown, chmod |
6 | |
6 | |
7 | BEGIN { |
7 | BEGIN { |
8 | print "1..38\n"; |
8 | print "1..37\n"; |
9 | print "ok 1 # MODEL=$AnyEvent::IO::MODEL\n"; |
9 | print "ok 1 # MODEL=$AnyEvent::IO::MODEL\n"; |
10 | } |
10 | } |
11 | use AnyEvent; |
11 | use AnyEvent; |
12 | use AnyEvent::IO qw(:DEFAULT :flags); |
12 | use AnyEvent::IO qw(:DEFAULT :flags); |
13 | BEGIN { |
13 | BEGIN { |
… | |
… | |
41 | t 0, open => "$DIR/test", O_CREAT | O_EXCL | O_WRONLY, 0666; |
41 | t 0, open => "$DIR/test", O_CREAT | O_EXCL | O_WRONLY, 0666; |
42 | |
42 | |
43 | t 0, rmdir => $DIR; |
43 | t 0, rmdir => $DIR; |
44 | |
44 | |
45 | t 1, write => $fh, "tes--"; |
45 | t 1, write => $fh, "tes--"; |
46 | t 1, write => $fh, "test2truncate"; |
46 | t 1, write => $fh, "test2"; |
47 | t 1, write => $fh, ""; |
47 | t 1, write => $fh, ""; |
48 | |
48 | |
49 | t 1, seek => $fh, 3, 0; |
49 | t 1, seek => $fh, 3, 0; |
50 | t 1, write => $fh, "t1"; |
50 | t 1, write => $fh, "t1"; |
51 | |
51 | |
52 | t 1, truncate => $fh, 5+5; |
52 | #t 1, truncate => $fh, 5+5; # not available on windows |
53 | |
53 | |
54 | t 1, stat => $fh; |
54 | t 1, stat => $fh; |
55 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # stat size\n"; |
55 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # stat size\n"; |
56 | |
56 | |
57 | t 1, close => $fh; |
57 | t 1, close => $fh; |
58 | |
58 | |
59 | t 1, stat => "$DIR/test"; |
59 | t 1, stat => "$DIR/test"; |
60 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # stat size\n"; |
60 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # stat size (", -s _,")\n"; |
61 | |
61 | |
62 | t 1, lstat => "$DIR/test"; |
62 | t 1, lstat => "$DIR/test"; |
63 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n"; |
63 | print -s _ != 10 ? "not " : "", "ok ", $t++, " # lstat size\n"; |
64 | |
64 | |
65 | t 1, rename => "$DIR/test", "$DIR/test2"; |
65 | t 1, rename => "$DIR/test", "$DIR/test2"; |