summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorericm <ericm>2000-09-17 22:40:40 (GMT)
committerericm <ericm>2000-09-17 22:40:40 (GMT)
commitbf2b535e3645d67bbadc76481d3aa3c67c395cb0 (patch)
tree60cb56b04f1ab54b6e1a59c6e478a2e17766d532 /tests
parent9e68d5fcbb5c7e9d1e17dcaacab6688f786bcd10 (diff)
downloadtcl-bf2b535e3645d67bbadc76481d3aa3c67c395cb0.zip
tcl-bf2b535e3645d67bbadc76481d3aa3c67c395cb0.tar.gz
tcl-bf2b535e3645d67bbadc76481d3aa3c67c395cb0.tar.bz2
* tests/cmdIL.test: Added a test for fix for [Bug: 6212].
* generic/tclCmdIL.c (Tcl_LsortObjCmd): Applied patch from [Bug: 6212], which corrected an error in the handling of the -index option.
Diffstat (limited to 'tests')
-rw-r--r--tests/cmdIL.test18
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.