summaryrefslogtreecommitdiffstats
path: root/tests/lreplace.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-15 11:17:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-07-15 11:17:12 (GMT)
commitbc9648f913a629f7845e64a802b2519bb5a729a7 (patch)
tree9d409ee7e8ffe0438cb59bb04e9f3c8d2ea58455 /tests/lreplace.test
parent2785816f6adac764ff1a93a100bc8cae1464227f (diff)
parentb4b28f993fd2ed7a128731d3d5cc73a1fec73e33 (diff)
downloadtcl-bc9648f913a629f7845e64a802b2519bb5a729a7.zip
tcl-bc9648f913a629f7845e64a802b2519bb5a729a7.tar.gz
tcl-bc9648f913a629f7845e64a802b2519bb5a729a7.tar.bz2
Diffstat (limited to 'tests/lreplace.test')
-rw-r--r--tests/lreplace.test37
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/lreplace.test b/tests/lreplace.test
index d1319c6..e66a331 100644
--- a/tests/lreplace.test
+++ b/tests/lreplace.test
@@ -133,7 +133,6 @@ test lreplace-3.1 {lreplace won't modify shared argument objects} {
test lreplace-4.1 {Bug ccc2c2cc98: lreplace edge case} {
lreplace {} 1 1
} {}
-# Note that this test will fail in 8.5
test lreplace-4.2 {Bug ccc2c2cc98: lreplace edge case} {
lreplace { } 1 1
} {}
@@ -146,6 +145,42 @@ test lreplace-4.4 {lreplace edge case} {
test lreplace-4.5 {lreplace edge case} {
lreplace {1 2 3 4 5} 3 0 _
} {1 2 3 _ 4 5}
+test lreplace-4.6 {lreplace end-x: bug a4cb3f06c4} {
+ lreplace {0 1 2 3 4} 0 end-2
+} {3 4}
+test lreplace-4.6.1 {lreplace end-x: bug a4cb3f06c4} {
+ lreplace {0 1 2 3 4} 0 end-2 a b c
+} {a b c 3 4}
+test lreplace-4.7 {lreplace with two end-indexes: increasing} {
+ lreplace {0 1 2 3 4} end-2 end-1
+} {0 1 4}
+test lreplace-4.7.1 {lreplace with two end-indexes: increasing} {
+ lreplace {0 1 2 3 4} end-2 end-1 a b c
+} {0 1 a b c 4}
+test lreplace-4.8 {lreplace with two end-indexes: equal} {
+ lreplace {0 1 2 3 4} end-2 end-2
+} {0 1 3 4}
+test lreplace-4.8.1 {lreplace with two end-indexes: equal} {
+ lreplace {0 1 2 3 4} end-2 end-2 a b c
+} {0 1 a b c 3 4}
+test lreplace-4.9 {lreplace with two end-indexes: decreasing} {
+ lreplace {0 1 2 3 4} end-2 end-3
+} {0 1 2 3 4}
+test lreplace-4.9.1 {lreplace with two end-indexes: decreasing} {
+ lreplace {0 1 2 3 4} end-2 end-3 a b c
+} {0 1 a b c 2 3 4}
+test lreplace-4.10 {lreplace with two equal indexes} {
+ lreplace {0 1 2 3 4} 2 2
+} {0 1 3 4}
+test lreplace-4.10.1 {lreplace with two equal indexes} {
+ lreplace {0 1 2 3 4} 2 2 a b c
+} {0 1 a b c 3 4}
+test lreplace-4.11 {lreplace end index first} {
+ lreplace {0 1 2 3 4} end-2 1 a b c
+} {0 1 a b c 2 3 4}
+test lreplace-4.12 {lreplace end index first} {
+ lreplace {0 1 2 3 4} end-2 2 a b c
+} {0 1 a b c 3 4}
# cleanup
catch {unset foo}