diff options
author | griffin <briang42@easystreet.net> | 2023-04-16 18:36:18 (GMT) |
---|---|---|
committer | griffin <briang42@easystreet.net> | 2023-04-16 18:36:18 (GMT) |
commit | 2aed8b1bdf7c0dc11150a3b6943f1243444d82ef (patch) | |
tree | f0b97714c1c810b4510de81a0e6216d895494b58 /tests/lseq.test | |
parent | 0ceb73f34c1bca398ed4c6e9ceaf1e00eb23006d (diff) | |
download | tcl-2aed8b1bdf7c0dc11150a3b6943f1243444d82ef.zip tcl-2aed8b1bdf7c0dc11150a3b6943f1243444d82ef.tar.gz tcl-2aed8b1bdf7c0dc11150a3b6943f1243444d82ef.tar.bz2 |
Fix bug-fa00fbbbabe - seq / lindex discrepancies
Replace macros with static inline functions.
Limit ArithSeries list size to LIST_MAX. This way, shimmering less likely to fail if it happens.
Speed up UpdateStringOfArithSeries.
Fixed issues around indexing into vary large lseq lists.
Diffstat (limited to 'tests/lseq.test')
-rw-r--r-- | tests/lseq.test | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/lseq.test b/tests/lseq.test index 1dff72d..403715a 100644 --- a/tests/lseq.test +++ b/tests/lseq.test @@ -538,12 +538,12 @@ test lseq-4.8 {error case lrange} -body { } -returnCodes 1 \ -result {bad index "fred": must be integer?[+-]integer? or end?[+-]integer?} -test lseq-4.9 {error case lrange} -body { - set fred 7 - set ginger 8 - lrange [lseq 1 5] $fred $ginger -} -returnCodes 1 \ - -result {index 7 is out of bounds 0 to 4} +test lseq-4.9 {lrange empty/partial sets} -body { + foreach {fred ginger} {7 8 4 9 0 15 9 9 4 2} { + lappend res [lrange [lseq 1 5] $fred $ginger] + } + set res +} -result {{} 5 {1 2 3 4 5} {} {}} # Panic when using variable value? test lseq-4.10 {panic using variable index} { @@ -551,6 +551,13 @@ test lseq-4.10 {panic using variable index} { lindex [lseq 10] $i } {0} +test lseq-4.11 {bug lseq / lindex discrepancies} { + lindex [lseq 0x7fffffff] 0x80000000 +} {} + +test lseq-4.12 {bug lseq} { + llength [lseq 0x100000000] +} {4294967296} # cleanup ::tcltest::cleanupTests |