10_splice_rs.t revision 1
1N/A# Check SPLICE function's effect on the file 1N/A# Each call to 'check_contents' actually performs two tests. 1N/A# First, it calls the tied object's own 'check_integrity' method, 1N/A# which makes sure that the contents of the read cache and offset tables 1N/A# accurately reflect the contents of the file. 1N/A# Then, it checks the actual contents of the file against the expected 1N/Aprint "ok $N\n"; $N++;
# partial credit just for showing up 1N/Aprint $o ?
"ok $N\n" :
"not ok $N\n";
1N/A# (3-22) 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# (23-42) 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# (43-62) 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# (63-82) 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# (83-84) scrub it all out 1N/A# (85-86) put some back in 1N/A# (87-88) what if we remove too many records? 1N/A# (89-92) In the past, splicing past the end was not correctly detected 1N/A# (93-96) Also we did not emulate splice's freaky behavior when inserting 1N/A# past the end of the array (1.14) 1N/A# (97) Splicing with too large a negative number should be fatal 1N/A# This test ignored because it causes 5.6.1 and 5.7.3 to dump core 1N/A# It also garbles the stack under 5.005_03 (20020401) 1N/A ? "ok $N\n" : "not ok $N \# \$\@ was '$@'\n"; 1N/A print "ok $N \# skipped (versions through 5.7.3 dump core here.)\n"; 1N/A# (98-101) Test default arguments