diff options
author | sebres <sebres@users.sourceforge.net> | 2018-03-06 22:27:47 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2018-03-06 22:27:47 (GMT) |
commit | 8c2cbf32116e7f5f5952e0d063a90125fcd4147d (patch) | |
tree | b0688bcbde7005de589f7cac2dd4f5f2405a80b3 /tests/cmdIL.test | |
parent | c68d043691c94408564f252d18ffce9db7afcdad (diff) | |
download | tcl-8c2cbf32116e7f5f5952e0d063a90125fcd4147d.zip tcl-8c2cbf32116e7f5f5952e0d063a90125fcd4147d.tar.gz tcl-8c2cbf32116e7f5f5952e0d063a90125fcd4147d.tar.bz2 |
test cases for "lsort": coverage for "missing from sublist" error case with negative index (-1-1, -2)
Diffstat (limited to 'tests/cmdIL.test')
-rw-r--r-- | tests/cmdIL.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cmdIL.test b/tests/cmdIL.test index 23a5f96..7636adc 100644 --- a/tests/cmdIL.test +++ b/tests/cmdIL.test @@ -203,6 +203,18 @@ test cmdIL-3.4.1 {SortCompare procedure, -index option} -body { test cmdIL-3.5 {SortCompare procedure, -index option} -body { lsort -integer -index 2 {{20 10 13} {15}} } -returnCodes error -result {element 2 missing from sublist "15"} +test cmdIL-3.5.1 {SortCompare procedure, -index option (out of range, calculated index)} -body { + lsort -index 1+3 {{1 . c} {2 . b} {3 . a}} +} -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 {element -2 missing from sublist "1 . c"} +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 {element -2 missing from sublist "1 . c"} +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 -2 missing from sublist "1 . c"} test cmdIL-3.6 {SortCompare procedure, -index option} { lsort -integer -index 2 {{1 15 30} {2 5 25} {3 25 20}} } {{3 25 20} {2 5 25} {1 15 30}} |