diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-29 21:42:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-29 21:42:18 (GMT) |
commit | 520e0c9938ef5229a94dd4d50005f141db548e69 (patch) | |
tree | 8d9204fce9d09230622a141a301e1ef225fb8784 /tests/cmdIL.test | |
parent | 4cca9ff9e3ec22ef897c6160c3520c6b7ba58271 (diff) | |
download | tcl-520e0c9938ef5229a94dd4d50005f141db548e69.zip tcl-520e0c9938ef5229a94dd4d50005f141db548e69.tar.gz tcl-520e0c9938ef5229a94dd4d50005f141db548e69.tar.bz2 |
Better error-message in case of "index out of range", mentioning the actual index which was out of range. Also, use the same error-code, because the underlying cause is all the same.
Diffstat (limited to 'tests/cmdIL.test')
-rw-r--r-- | tests/cmdIL.test | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/cmdIL.test b/tests/cmdIL.test index 05b5040..fe72d94 100644 --- a/tests/cmdIL.test +++ b/tests/cmdIL.test @@ -163,10 +163,10 @@ test cmdIL-1.40 {Tcl_LsortObjCmd procedure, Bug 8e1e31eac0fd6b6c} { } [list \0 \x7f \x80 \uffff \U01ffff] test cmdIL-1.41 {lsort -stride and -index} -body { lsort -stride 2 -index -2 {a 2 b 1} -} -returnCodes error -result {index "-2" cannot select an element from any list} +} -returnCodes error -result {index "-2" out of range} test cmdIL-1.42 {lsort -stride and-index} -body { lsort -stride 2 -index -1-1 {a 2 b 1} -} -returnCodes error -result {index "-1-1" cannot select an element from any list} +} -returnCodes error -result {index "-1-1" out of range} # Can't think of any good tests for the MergeSort and MergeLists procedures, # except a bunch of random lists to sort. @@ -228,10 +228,10 @@ test cmdIL-3.5.1 {SortCompare procedure, -index option (out of range, calculated } -returnCodes error -result {element 4 missing from sublist "1 . c"} test cmdIL-3.5.2 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index -1-1 {{1 . c} {2 . b} {3 . a}} -} -returnCodes error -result {index "-1-1" cannot select an element from any list} +} -returnCodes error -result {index "-1-1" out of range} test cmdIL-3.5.3 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index -2 {{1 . c} {2 . b} {3 . a}} -} -returnCodes error -result {index "-2" cannot select an element from any list} +} -returnCodes error -result {index "-2" out of range} test cmdIL-3.5.4 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end-4 {{1 . c} {2 . b} {3 . a}} } -returnCodes error -result {element end-4 missing from sublist "1 . c"} @@ -243,13 +243,13 @@ test cmdIL-3.5.6 {SortCompare procedure, -index option} { } {a \{} test cmdIL-3.5.7 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end--1 {{1 . c} {2 . b} {3 . a}} -} -returnCodes error -result {index "end--1" cannot select an element from any list} +} -returnCodes error -result {index "end--1" out of range} test cmdIL-3.5.8 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end+1 {{1 . c} {2 . b} {3 . a}} -} -returnCodes error -result {index "end+1" cannot select an element from any list} +} -returnCodes error -result {index "end+1" out of range} test cmdIL-3.5.9 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index end+2 {{1 . c} {2 . b} {3 . a}} -} -returnCodes error -result {index "end+2" cannot select an element from any list} +} -returnCodes error -result {index "end+2" out of range} test cmdIL-3.5.10 {SortCompare procedure, -index option (out of range, calculated index)} -body { lsort -index 0 {{}} } -returnCodes error -result {element 0 missing from sublist ""} |