Upgrade to Tie::File 0.90, from mjd.
[p5sagit/p5-mst-13.2.git] / lib / Tie / File / t / 01_gen.t
index fd1dd2e..f86fdd4 100644 (file)
@@ -2,13 +2,13 @@
 
 my $file = "tf$$.txt";
 
-print "1..62\n";
+print "1..68\n";
 
 my $N = 1;
 use Tie::File;
 print "ok $N\n"; $N++;
 
-my $o = tie @a, 'Tie::File', $file, autochomp => 0;
+my $o = tie @a, 'Tie::File', $file, autochomp => 0, autodefer => 0;
 print $o ? "ok $N\n" : "not ok $N\n";
 $N++;
 
@@ -70,6 +70,18 @@ check_contents();
 $a[3] = "rec3";
 check_contents("", "", "", "rec3");
 
+# (63-68) 20020326 You thought there would be a bug in STORE where if
+# a cached record was false, STORE wouldn't see it at all.  But you
+# forgot that records always come back from the cache with the record
+# separator attached, so they are unlikely to be false.  The only
+# really weird case is when the cached record is empty and the record
+# separator is "0".  Test that in 09_gen_rs.t.
+$a[1] = "0";
+check_contents("", "0", "", "rec3");
+$a[1] = "whoops";
+check_contents("", "whoops", "", "rec3");
+
+
 use POSIX 'SEEK_SET';
 sub check_contents {
   my @c = @_;