projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Implement Hash/Array ~~ Regex (with tests)
[p5sagit/p5-mst-13.2.git]
/
t
/
io
/
read.t
1
#!./perl
2
3
BEGIN {
4
chdir 't' if -d 't';
5
@INC = '../lib';
6
require './test.pl';
7
}
8
9
use strict;
10
eval 'use Errno';
11
die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
12
13
plan tests => 2;
14
15
my $tmpfile = tempfile();
16
17
open(A,"+>$tmpfile");
18
print A "_";
19
seek(A,0,0);
20
21
my $b = "abcd";
22
$b = "";
23
24
read(A,$b,1,4);
25
26
close(A);
27
28
is($b,"\000\000\000\000_"); # otherwise probably "\000bcd_"
29
30
SKIP: {
31
skip "no EBADF", 1 if (!exists &Errno::EBADF);
32
33
$! = 0;
34
no warnings 'unopened';
35
read(B,$b,1);
36
ok($! == &Errno::EBADF);
37
}