Commit | Line | Data |
---|---|---|
61f2b451 | 1 | #!./perl |
61f2b451 | 2 | |
3 | BEGIN { | |
7a4c00b4 | 4 | unless(grep /blib/, @INC) { |
5 | chdir 't' if -d 't'; | |
20822f61 | 6 | @INC = '../lib'; |
7a4c00b4 | 7 | } |
8 | } | |
9 | ||
10 | use Config; | |
11 | ||
12 | BEGIN { | |
d846159b | 13 | if($ENV{PERL_CORE}) { |
14 | if ($Config{'extensions'} !~ /\bIO\b/) { | |
15 | print "1..0 # Skip: IO extension not built\n"; | |
7a4c00b4 | 16 | exit 0; |
17 | } | |
61f2b451 | 18 | } |
d846159b | 19 | if( $^O eq 'VMS' && $Config{'vms_cc_type'} ne 'decc' ) { |
20 | print "1..0 # Skip: not compatible with the VAXCRTL\n"; | |
21 | exit 0; | |
22 | } | |
61f2b451 | 23 | } |
24 | ||
25 | use IO::File; | |
26 | use IO::Seekable; | |
27 | ||
1e9fe98f | 28 | print "1..4\n"; |
fefb1980 | 29 | |
61f2b451 | 30 | $x = new_tmpfile IO::File or print "not "; |
31 | print "ok 1\n"; | |
32 | print $x "ok 2\n"; | |
33 | $x->seek(0,SEEK_SET); | |
34 | print <$x>; | |
fefb1980 | 35 | |
36 | $x->seek(0,SEEK_SET); | |
37 | print $x "not ok 3\n"; | |
38 | $p = $x->getpos; | |
39 | print $x "ok 3\n"; | |
40 | $x->flush; | |
41 | $x->setpos($p); | |
42 | print scalar <$x>; | |
43 | ||
44 | $! = 0; | |
45 | $x->setpos(undef); | |
46 | print $! ? "ok 4 # $!\n" : "not ok 4\n"; | |
a6a714bd | 47 |