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 { |
13 | if(-d "lib" && -f "TEST") { |
14 | if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') { |
15 | print "1..0\n"; |
16 | exit 0; |
17 | } |
61f2b451 |
18 | } |
19 | } |
20 | |
21 | use IO::File; |
22 | use IO::Seekable; |
23 | |
fefb1980 |
24 | print "1..4\n"; |
25 | |
61f2b451 |
26 | $x = new_tmpfile IO::File or print "not "; |
27 | print "ok 1\n"; |
28 | print $x "ok 2\n"; |
29 | $x->seek(0,SEEK_SET); |
30 | print <$x>; |
fefb1980 |
31 | |
32 | $x->seek(0,SEEK_SET); |
33 | print $x "not ok 3\n"; |
34 | $p = $x->getpos; |
35 | print $x "ok 3\n"; |
36 | $x->flush; |
37 | $x->setpos($p); |
38 | print scalar <$x>; |
39 | |
40 | $! = 0; |
41 | $x->setpos(undef); |
42 | print $! ? "ok 4 # $!\n" : "not ok 4\n"; |