19_cache.t revision 1
1N/A# Tests for various caching errors 1N/Aprint "ok $N\n"; $N++;
1N/Aprint $o ?
"ok $N\n" :
"not ok $N\n";
1N/A# (3) Through 0.18, this 'splice' call would corrupt the cache. 1N/Amy @z = @a;
# force cache to contain all ten records 1N/A# Here we redo *all* the splice tests, with populate() 1N/A# calls before each one, to make sure that splice() does not botch the cache. 1N/A# (4-14) splicing at the beginning 1N/Asplice(@a, 0, 0, 'r7', 'rec8');
# insert more than one 1N/Asplice(@a, 0, 2, 'rec7', 'record8', 'rec9');
# insert more than delete 1N/Asplice(@a, 0, 3, 'record9', 'rec10');
# delete more than insert 1N/A# (15-24) splicing in the middle 1N/Asplice(@a, 1, 0, 'r7', 'rec8');
# insert more than one 1N/Asplice(@a, 1, 2, 'rec7', 'record8', 'rec9');
# insert more than delete 1N/Asplice(@a, 1, 3, 'record9', 'rec10');
# delete more than insert 1N/A# (25-34) splicing at the end 1N/Asplice(@a, 3, 0, 'r7', 'rec8');
# insert more than one 1N/Asplice(@a, 3, 2, 'rec7', 'record8', 'rec9');
# insert more than delete 1N/Asplice(@a, 3, 3, 'record9', 'rec10');
# delete more than insert 1N/A# (35-44) splicing with negative subscript 1N/Asplice(@a, -1, 0, 'r7', 'rec8');
# insert more than one 1N/Asplice(@a, -1, 2, 'rec7', 'record8', 'rec9');
# insert more than delete 1N/Asplice(@a, -3, 3, 'record9', 'rec10');
# delete more than insert 1N/A# (45) scrub it all out 1N/A# (46) put some back in 1N/A# (47) what if we remove too many records? 1N/A# (48-49) In the past, splicing past the end was not correctly detected 1N/A# (50-51) Also we did not emulate splice's freaky behavior when inserting 1N/A# past the end of the array (1.14) 1N/A# (52-54) Test default arguments 1N/A# (55) This was broken on 20030507 when you moved the cache management 1N/A# stuff out of _oadjust back into _splice without also putting it back 1N/A my @z = @a; # refill the cache with correct data