source: trunk/essentials/dev-lang/perl/t/io/read.t

Last change on this file was 3181, checked in by bird, 18 years ago

perl 5.8.8

File size: 504 bytes
Line 
1#!./perl
2
3# $RCSfile$
4
5BEGIN {
6 chdir 't' if -d 't';
7 @INC = '../lib';
8 require './test.pl';
9}
10
11use strict;
12eval 'use Errno';
13die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
14
15plan tests => 2;
16
17open(A,"+>a");
18print A "_";
19seek(A,0,0);
20
21my $b = "abcd";
22$b = "";
23
24read(A,$b,1,4);
25
26close(A);
27
28unlink("a");
29
30is($b,"\000\000\000\000_"); # otherwise probably "\000bcd_"
31
32unlink 'a';
33
34SKIP: {
35 skip "no EBADF", 1 if (!exists &Errno::EBADF);
36
37 $! = 0;
38 read(B,$b,1);
39 ok($! == &Errno::EBADF);
40}
Note: See TracBrowser for help on using the repository browser.