diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cmdIL.test | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/cmdIL.test b/tests/cmdIL.test index b4b23f0..d6f68a3 100644 --- a/tests/cmdIL.test +++ b/tests/cmdIL.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: cmdIL.test,v 1.12 2000/04/10 17:18:57 ericm Exp $ +# RCS: @(#) $Id: cmdIL.test,v 1.13 2000/09/17 22:40:41 ericm Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -82,6 +82,22 @@ test cmdIL-1.23 {Tcl_LsortObjCmd procedure, unique sort with index} { # lsort -unique should return the last unique item lsort -unique -index 0 {{a b} {c b} {a c} {d a}} } {{a c} {c b} {d a}} +test cmdIL-1.24 {Tcl_LsortObjCmd procedure, order of -index and -command} { + catch {rename 1 ""} + proc testcmp {a b} {return [string compare $a $b]} + set l [list [list a b] [list c d]] + set result [list [catch {lsort -command testcmp -index 1 $l} msg] $msg] + rename testcmp "" + set result +} [list 0 [list [list a b] [list c d]]] +test cmdIL-1.25 {Tcl_LsortObjCmd procedure, order of -index and -command} { + catch {rename 1 ""} + proc testcmp {a b} {return [string compare $a $b]} + set l [list [list a b] [list c d]] + set result [list [catch {lsort -index 1 -command testcmp $l} msg] $msg] + rename testcmp "" + set result +} [list 0 [list [list a b] [list c d]]] # Can't think of any good tests for the MergeSort and MergeLists # procedures, except a bunch of random lists to sort. |