ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/03_errors.t
(Generate patch)

Comparing IO-AIO/t/03_errors.t (file contents):
Revision 1.4 by root, Wed Oct 25 08:17:22 2006 UTC vs.
Revision 1.6 by root, Thu Jan 7 18:25:51 2010 UTC

5use POSIX qw(ENOENT EACCES EBADF); 5use POSIX qw(ENOENT EACCES EBADF);
6use FindBin; 6use FindBin;
7use lib "$FindBin::Bin"; 7use lib "$FindBin::Bin";
8use aio_test_common; 8use aio_test_common;
9 9
10BEGIN { plan tests => 13 } 10BEGIN { plan tests => 12 }
11 11
12IO::AIO::min_parallel 2; 12IO::AIO::min_parallel 2;
13 13
14my $tempdir = tempdir(); 14my $tempdir = tempdir();
15 15
41}; 41};
42pcb; 42pcb;
43 43
44# write to file open for reading 44# write to file open for reading
45ok(open(F, $some_file)) or die $!; 45ok(open(F, $some_file)) or die $!;
46aio_write *F, 0, 10, "foobarbaz.", 0, sub { 46eval { aio_write *F, 0, 10, "foobarbaz.", 0, sub { ok (0) } };
47 my $written = shift; 47ok ($@ =~ /mode mismatch/);
48 ok($written < 0);
49 ok($! == EBADF);
50};
51pcb; 48pcb;
52 49
53close F; 50close F;
54 51
55aio_symlink "\\test\\", $some_link, sub { 52aio_symlink "\\test\\", $some_link, sub {
53 if ($^O eq "cygwin") {
54 ok (1);
55 ok (1);
56 } else {
56 ok (!$_[0]); 57 ok (!$_[0]);
57 ok ("\\test\\" eq readlink $some_link); 58 ok ("\\test\\" eq readlink $some_link);
59 }
58}; 60};
59pcb; 61pcb;
60unlink $some_link; 62unlink $some_link;
61 63
62# test unlinking and rmdir 64# test unlinking and rmdir

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines