25_gen_nocache.t revision 1
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# Regular read-write tests with caching disabled
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robjprint "1..68\n";
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robjprint "ok $N\n"; $N++;
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robjmy $o = tie @a, 'Tie::File', $file, autochomp => 0, autodefer => 0, memory => 0;
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# 3-5 create
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# 6-11 append
e3d60c9bd991a9826cbfa63b10595d44e123b9c4Adrian Frost# 12-20 same-length alterations
cf327f5a61bfa78d5cf81410e439640e480f850bRobert Johnston# 21-35 lengthening alterations
cf327f5a61bfa78d5cf81410e439640e480f850bRobert Johnstoncheck_contents("longer0", "longer1", "long2");
cf327f5a61bfa78d5cf81410e439640e480f850bRobert Johnston# 36-50 shortening alterations, including truncation
cf327f5a61bfa78d5cf81410e439640e480f850bRobert Johnstoncheck_contents("short0", "longer1", "long2");
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# (51-56) file with holes
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnstoncheck_contents("sh0", "sh1", "short2", "", "rec4");
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnstoncheck_contents("sh0", "sh1", "short2", "rec3", "rec4");
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# (57-59) zero out file
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# (60-62) insert into the middle of an empty file
7fcedef2cb0c5f9b2168d8c757cf243facdec1e6Robert Johnston# (63-68) 20020326 You thought there would be a bug in STORE where if
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# a cached record was false, STORE wouldn't see it at all. But you
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# forgot that records always come back from the cache with the record
2eeaed14a5e2ed9bd811643ad5bffc3510ca0310robj# separator attached, so they are unlikely to be false. The only
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj# really weird case is when the cached record is empty and the record
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj# separator is "0". Test that in 09_gen_rs.t.
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj my @c = @_;
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj local *FH = $o->{fh};
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj# my $open = open FH, "< $file";
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj my $aa = $a[$_];
825ba0f20a74fd9c5d0d1ce2c195da2cc88a7f77robj s/\n/\\n/g;