Integrate mainline - all tests pass - some noise from threads
authorNick Ing-Simmons <nik@tiuk.ti.com>
Mon, 4 Mar 2002 14:08:38 +0000 (14:08 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Mon, 4 Mar 2002 14:08:38 +0000 (14:08 +0000)
av_simple (SuSE7.3).

p4raw-id: //depot/perlio@14992

1  2 
embed.fnc
lib/Tie/File/t/01_gen.t
lib/Tie/File/t/04_splice.t
lib/Tie/File/t/10_splice_rs.t

diff --cc embed.fnc
Simple merge
@@@ -76,11 -83,20 +83,16 @@@ sub check_contents 
  
    # now check FETCH:
    my $good = 1;
+   my $msg;
    for (0.. $#c) {
-     $good = 0 unless $a[$_] eq "$c[$_]$/";
+     unless ($a[$_] eq "$c[$_]$/") {
+       $msg = "expected $c[$_]$/, got $a[$_]";
+       $msg =~ s{$/}{\\n}g;
+       $good = 0;
+     }
    }
-   print (($open && $good) ? "ok $N\n" : "not ok $N # fetch @c\n");
+   print $good ? "ok $N\n" : "not ok $N # $msg\n";
    $N++;
 -
 -  print $o->_check_integrity($file, $ENV{INTEGRITY}) 
 -      ? "ok $N\n" : "not ok $N\n";
 -  $N++;
  }
  
  END {
Simple merge
@@@ -136,6 -138,40 +138,40 @@@ check_contents("rec0blahrec1blah")
  splice(@a, 0, 17);
  check_contents("");
  
 -# This test ignored because it causes 5.6.1 and 5.7.3 to dump core
+ # (89-92) In the past, splicing past the end was not correctly detected
+ # (1.14)
+ splice(@a, 89, 3);
+ check_contents("");
+ splice(@a, @a, 3);
+ check_contents("");
+ # (93-96) Also we did not emulate splice's freaky behavior when inserting
+ # past the end of the array (1.14)
+ splice(@a, 89, 0, "I", "like", "pie");
+ check_contents("Iblahlikeblahpieblah");
+ splice(@a, 89, 0, "pie pie pie");
+ check_contents("Iblahlikeblahpieblahpie pie pieblah");
+ # (97) Splicing with too large a negative number should be fatal
 -if ($] < 5.006 || $] > 5.007003) {
++# This test ignored because it causes 5.6.1 and 5.7.2 to dump core
+ # NOT MY FAULT
 -  print "ok $N \# skipped (5.6.0 through 5.7.3 dump core here.)\n";
++if ($] < 5.006 || $] > 5.007002) {
+   eval { splice(@a, -7, 0) };
+   print $@ =~ /^Modification of non-creatable array value attempted, subscript -7/
+       ? "ok $N\n" : "not ok $N \# \$\@ was '$@'\n";
+ } else { 
++  print "ok $N \# skipped (5.6.0 through 5.7.2 dump core here.)\n";
+ }
+ $N++;
+        
+ # (98-101) Test default arguments
+ splice @a, 0, 0, (0..11);
+ splice @a, 4;
+ check_contents("0blah1blah2blah3blah");
+ splice @a;
+ check_contents("");
  sub init_file {
    my $data = shift;
    open F, "> $file" or die $!;