Retract #20260.
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / t / io_xs.t
1 #!./perl
2
3 BEGIN {
4     unless(grep /blib/, @INC) {
5         chdir 't' if -d 't';
6         @INC = '../lib';
7     }
8 }
9
10 use Config;
11
12 BEGIN {
13     if($ENV{PERL_CORE}) {
14         if ($Config{'extensions'} !~ /\bIO\b/) {
15             print "1..0 # Skip: IO extension not built\n";
16             exit 0;
17         }
18     }
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     }
23 }
24
25 use IO::File;
26 use IO::Seekable;
27
28 print "1..4\n";
29
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>;
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";
47