3 # Tests for various caching errors
8 unless ($Config{d_alarm}) {
12 $: = Tie::File::_default_recsep();
13 my $data = join $:, "record0" .. "record9", "";
14 my $V = $ENV{INTEGRITY}; # Verbose integrity checking?
20 print "ok $N\n"; $N++;
22 open F, "> $file" or die $!;
27 # Limit cache size to 30 bytes
29 # -- that's enough space for 3 records, but not 4, on both \n and \r\n systems
30 my $o = tie @a, 'Tie::File', $file, memory => $MAX, autodefer => 1;
31 print $o ? "ok $N\n" : "not ok $N\n";
34 # (3) In 0.50 this goes into an infinite loop. Explanation:
36 # Suppose you overfill the defer buffer by so much that the memory
37 # limit is also exceeded. You'll go into _splice to prepare to
38 # write out the defer buffer, and _splice will call _fetch, which
39 # will then try to flush the read cache---but the read cache is
40 # already empty, so you're stuck in an infinite loop.
42 # Five seconds should be plenty of time for it to complete if it works.
44 @a = "record0" .. "record9";