diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-06-03 13:42:45 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-06-03 13:44:22 +1000 |
commit | 126a13ebb22f25852b4068385faa50f3bda5d210 (patch) | |
tree | 0baf37bbfcdd656e11cb7fb19bc5ed240380b7f8 /tests | |
parent | dbd2f51e0be6668974f2616e1104762d8b1d5e85 (diff) | |
download | jimtcl-126a13ebb22f25852b4068385faa50f3bda5d210.zip jimtcl-126a13ebb22f25852b4068385faa50f3bda5d210.tar.gz jimtcl-126a13ebb22f25852b4068385faa50f3bda5d210.tar.bz2 |
lsort test should produce reliable results
Previously different systems could produce different, valid results
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lsort.test | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/lsort.test b/tests/lsort.test index b4eba95..a01b14f 100644 --- a/tests/lsort.test +++ b/tests/lsort.test @@ -29,7 +29,11 @@ test lsort-1.5 {Tcl_LsortObjCmd procedure, -command option} { } {1 {"-command" option must be followed by comparison command}} test lsort-1.6 {Tcl_LsortObjCmd procedure, -command option} { proc cmp {a b} { - expr {[string match x* $b] - [string match x* $a]} + set rc [expr {[string match x* $b] - [string match x* $a]}] + if {$rc == 0} { + set rc [string compare $a $b] + } + return $rc } lsort -command cmp {x1 abc x2 def x3 x4} } {x1 x2 x3 x4 abc def} |