summaryrefslogtreecommitdiffstats
path: root/tests/lreplace.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-06-18 17:26:59 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-06-18 17:26:59 (GMT)
commitad6cba5a8e20b73326e32fd7168a550c2a4090c7 (patch)
tree964864cddf7d81edadf7a390437a1c0d47e13939 /tests/lreplace.test
parente6c567a325651e8b157aca03154ce73e72cf55a7 (diff)
downloadtcl-ad6cba5a8e20b73326e32fd7168a550c2a4090c7.zip
tcl-ad6cba5a8e20b73326e32fd7168a550c2a4090c7.tar.gz
tcl-ad6cba5a8e20b73326e32fd7168a550c2a4090c7.tar.bz2
From aspect, several edge case coverage tests.
Diffstat (limited to 'tests/lreplace.test')
-rw-r--r--tests/lreplace.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/lreplace.test b/tests/lreplace.test
index 55bad37..50610dc 100644
--- a/tests/lreplace.test
+++ b/tests/lreplace.test
@@ -130,6 +130,58 @@ test lreplace-3.1 {lreplace won't modify shared argument objects} {
p
} "a b c"
+test lreplace-4.1 {Bug ccc2c2cc98: lreplace edge case} {
+ lreplace {} 1 1
+} {}
+test lreplace-4.2 {Bug ccc2c2cc98: lreplace edge case} {
+ lreplace { } 1 1
+} {}
+test lreplace-4.3 {lreplace edge case} {
+ lreplace {1 2 3} 2 0
+} {1 2 3}
+test lreplace-4.4 {lreplace edge case} {
+ lreplace {1 2 3 4 5} 3 1
+} {1 2 3 4 5}
+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}
::tcltest::cleanupTests