summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 11:43:29 (GMT)
committeraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 11:43:29 (GMT)
commite67be1a30592d2329563ef79cf7c0834664f4618 (patch)
tree32015c36fb90be397e1e9f8a9a2eb6980ba7efa1
parent200652b205a0115c80b4a03b815da7024e84e50e (diff)
downloadtcl-e67be1a30592d2329563ef79cf7c0834664f4618.zip
tcl-e67be1a30592d2329563ef79cf7c0834664f4618.tar.gz
tcl-e67be1a30592d2329563ef79cf7c0834664f4618.tar.bz2
add some tests for singleton list optimisation [738900]aspect_shimmer_singleton_lists
-rw-r--r--tests/listObj.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/listObj.test b/tests/listObj.test
index 1b9b542..dfa0854 100644
--- a/tests/listObj.test
+++ b/tests/listObj.test
@@ -170,6 +170,19 @@ test listobj-7.13 {Tcl_ListObjReplace, grow array, insert at end} {
test listobj-8.1 {SetListFromAny} {
lindex {0 foo\x00help 2} 1
} "foo\x00help"
+test listobj-8.2 {SetListFromAny with singleton optimisation: preserve string rep of float} {
+ set x " 1.3 ";llength $x;set x
+} " 1.3 "
+test listobj-8.3 {SetListFromAny with singleton optimisation: don't copy string rep of non-canonical float to new list} {
+ set x " 1.3 ";expr {log($x)};lindex $x 0
+} "1.3"
+test listobj-8.4 {SetListFromAny with singleton optimisation: preserve string rep of index} {
+ set x " end-1 ";lindex {a b c} $x;set x
+} " end-1 "
+test listobj-8.5 {SetListFromAny with singleton optimisation: don't copy string rep of non-canonical index to new list} {
+ set x " end-1 ";lindex {a b c} $x;lindex $x 0
+} "end-1"
+
test listobj-9.1 {UpdateStringOfList} {
string length [list foo\x00help]