summaryrefslogtreecommitdiffstats
path: root/tests/lseq.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lseq.test')
-rw-r--r--tests/lseq.test19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/lseq.test b/tests/lseq.test
index 3561d44..6ec9bb2 100644
--- a/tests/lseq.test
+++ b/tests/lseq.test
@@ -17,6 +17,7 @@ if {"::tcltest" ni [namespace children]} {
testConstraint arithSeriesDouble 1
testConstraint arithSeriesShimmer 1
testConstraint arithSeriesShimmerOk 1
+testConstraint knownBug 0
testConstraint has64BitLengths [expr {$tcl_platform(pointerSize) == 8}]
testConstraint has32BitLengths [expr {$tcl_platform(pointerSize) == 4}]
@@ -444,6 +445,21 @@ test lseq-3.31 {lreverse inplace with doubles} {arithSeriesDouble} {
# lsearch -
# -- should not shimmer lseq list
# -- should not leak lseq elements
+test lseq-3.32 {lsearch nested lists of lseq} arithSeriesShimmer {
+ set srchlist {}
+ for {set i 5} {$i < 25} {incr i} {
+ lappend srchlist [lseq $i count 7 by 3]
+ }
+ set a [lsearch -all -inline -index 1 $srchlist 23]
+ set b [lmap i $a {lindex [tcl::unsupported::representation $i] 3}]
+ list [lindex [tcl::unsupported::representation $a] 3] $a $b \
+ [lindex [tcl::unsupported::representation [lindex $srchlist 15]] 3]
+} {list {{20 23 26 29 32 35 38}} arithseries arithseries}
+
+
+# lsearch -
+# -- should not shimmer lseq list
+# -- should not leak lseq elements
test lseq-3.32 {lsearch nested lists of lseq} -constraints arithSeriesShimmer -body {
set srchlist {}
for {set i 5} {$i < 25} {incr i} {
@@ -565,9 +581,6 @@ test lseq-4.4.32 {lseq corner case} -constraints has32BitLengths -body {
test lseq-4.5 {lindex off by one} -body {
lappend res [eval {lindex [lseq 1 4] end}]
lappend res [eval {lindex [lseq 1 4] end-1}]
-} -setup {
- # Since 4.3 does not clean up and 4.4 may not run under constraint
- set res {}
} -cleanup {
unset res
} -result {4 3}