diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-12-20 08:58:50 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-12-26 18:08:29 +1000 |
commit | 058a5ef8474fb62f711d53e2fc8e2fa68fbb8996 (patch) | |
tree | 4b36cb4c1c12451a4d716b555c21437caffcd487 /tests/lsort.test | |
parent | 3627155c4a047bc491d45406b22a9038402ae964 (diff) | |
download | jimtcl-058a5ef8474fb62f711d53e2fc8e2fa68fbb8996.zip jimtcl-058a5ef8474fb62f711d53e2fc8e2fa68fbb8996.tar.gz jimtcl-058a5ef8474fb62f711d53e2fc8e2fa68fbb8996.tar.bz2 |
core: commands that take an index now use integer expressions
This means that instead of just [list index 2+1], we can now do
[list index end-$n*2+1]
This applies to:
lindex, linsert, lreplace, lset, lrange, lsort, regexp, regsub
string index,first,last,range
Also add tests for both direct integer expressions and indexes.
Still needs doc update.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/lsort.test')
-rw-r--r-- | tests/lsort.test | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/lsort.test b/tests/lsort.test index 5808b89..dd5a019 100644 --- a/tests/lsort.test +++ b/tests/lsort.test @@ -51,7 +51,7 @@ test lsort-1.11 {Tcl_LsortObjCmd procedure, -index option} { } {1 {"-index" option must be followed by list index}} test lsort-1.12 {Tcl_LsortObjCmd procedure, -index option} { list [catch {lsort -index foo {1 3 2 5}} msg] $msg -} {1 {bad index "foo": must be integer?[+-]integer? or end?[+-]integer?}} +} {1 {bad index "foo": must be intexpr or end?[+-]intexpr?}} test lsort-1.13 {Tcl_LsortObjCmd procedure, -index option} { lsort -index end -integer {{2 25} {10 20 50 100} {3 16 42} 1} } {1 {2 25} {3 16 42} {10 20 50 100}} |