This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Reverse the TODOs on t/op/regexp_qr_embed_thr.t - they all pass now.
[perl5.git] / t / io / read.t
CommitLineData
93c1eb4f 1#!./perl
2
b5fe5ca2
SR
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7}
8
9use strict;
43651d81
NC
10eval 'use Errno';
11die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
b5fe5ca2
SR
12
13plan tests => 2;
93c1eb4f 14
15open(A,"+>a");
16print A "_";
17seek(A,0,0);
18
b5fe5ca2 19my $b = "abcd";
93c1eb4f 20$b = "";
21
22read(A,$b,1,4);
23
24close(A);
25
55497cff 26unlink("a");
27
b5fe5ca2 28is($b,"\000\000\000\000_"); # otherwise probably "\000bcd_"
55497cff 29
30unlink 'a';
b5fe5ca2
SR
31
32SKIP: {
33 skip "no EBADF", 1 if (!exists &Errno::EBADF);
34
35 $! = 0;
3fb41248 36 no warnings 'unopened';
b5fe5ca2
SR
37 read(B,$b,1);
38 ok($! == &Errno::EBADF);
39}