This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Rename a variable
[perl5.git] / t / op / read.t
old mode 100755 (executable)
new mode 100644 (file)
index 23f1b51..a4ddc0d
@@ -1,13 +1,13 @@
 #!./perl
 
 BEGIN {
-    chdir 't';
-    @INC = '../lib';
+    chdir 't' if -d 't';
     require './test.pl';
+    set_up_inc('../lib');
 }
 use strict;
 
-plan tests => 2564;
+plan tests => 2116;
 
 open(FOO,'op/read.t') || open(FOO,'t/op/read.t') || open(FOO,':op:read.t') || die "Can't open op.read";
 seek(FOO,4,0) or die "Seek failed: $!";
@@ -33,7 +33,8 @@ my $has_perlio = !eval {
 
 my $tmpfile = tempfile();
 
-my (@values, @buffers) = ('', '');
+my @values  = ('');
+my @buffers = ('');
 
 foreach (65, 161, 253, 9786) {
     push @values, join "", map {chr $_} $_ .. $_ + 4;
@@ -59,6 +60,7 @@ foreach my $value (@values) {
            print FH $value;
            close FH;
            foreach my $offset (@offsets) {
+                next if !length($initial_buffer) && $offset != 0;
                foreach my $length (@lengths) {
                    # Will read the lesser of the length of the file and the
                    # read length