rename File::Glob::glob() to File::Glob::bsd_glob() to avoid
[p5sagit/p5-mst-13.2.git] / t / lib / io_xs.t
old mode 100644 (file)
new mode 100755 (executable)
index bff3d69..6bbba16
@@ -1,23 +1,42 @@
 #!./perl
-$| = 1;
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib' if -d '../lib';
-    require Config; import Config;
-    if ($Config{'extensions'} !~ /\bIO\b/ && !($^O eq 'VMS')) {
-       print "1..0\n";
-       exit 0;
+    unless(grep /blib/, @INC) {
+       chdir 't' if -d 't';
+       unshift @INC, '../lib' if -d '../lib';
+    }
+}
+
+use Config;
+
+BEGIN {
+    if(-d "lib" && -f "TEST") {
+        if ($Config{'extensions'} !~ /\bIO\b/ && $^O ne 'VMS') {
+           print "1..0\n";
+           exit 0;
+        }
     }
 }
 
 use IO::File;
 use IO::Seekable;
 
-print "1..2\n";
-use IO::File;
+print "1..4\n";
+
 $x = new_tmpfile IO::File or print "not ";
 print "ok 1\n";
 print $x "ok 2\n";
 $x->seek(0,SEEK_SET);
 print <$x>;
+
+$x->seek(0,SEEK_SET);
+print $x "not ok 3\n";
+$p = $x->getpos;
+print $x "ok 3\n";
+$x->flush;
+$x->setpos($p);
+print scalar <$x>;
+
+$! = 0;
+$x->setpos(undef);
+print $! ? "ok 4 # $!\n" : "not ok 4\n";