diff options
author | Evan Hunter <evan@ozhiker.com> | 2016-02-23 23:01:24 +0000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-03-27 11:01:48 +1000 |
commit | 73380285fac00fe416140e199794db8e074694ff (patch) | |
tree | 521c10d4065f94d5aa69a183abe17cb0d6d0dd06 /tests/lsort.test | |
parent | bdaf3ab542ffebc9121378e1dd9644196a4ad4a8 (diff) | |
download | jimtcl-73380285fac00fe416140e199794db8e074694ff.zip jimtcl-73380285fac00fe416140e199794db8e074694ff.tar.gz jimtcl-73380285fac00fe416140e199794db8e074694ff.tar.bz2 |
lsort test: allow unstable lsort implementation to return results of same value in different orders.
Diffstat (limited to 'tests/lsort.test')
-rw-r--r-- | tests/lsort.test | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/lsort.test b/tests/lsort.test index 28ebef6..ca2fc49 100644 --- a/tests/lsort.test +++ b/tests/lsort.test @@ -188,9 +188,14 @@ test lsort-3.21 {lsort, unique sort} { test lsort-3.22 {lsort, unique sort with index} { # lsort -unique should return the last unique item # Note that lsort is not guarunteed to be a stable sort, so - # allow for different - lsort -int -unique {0 5 05 00 004 4} -} {00 4 05} + # the resulting list is converted integers to allow + # for different ordering of items that have the same value + set vallist {} + foreach val [lsort -int -unique {0 5 05 00 004 4}] { + lappend vallist [expr int($val)] + } + set vallist +} {0 4 5} test lsort-4.26 {DefaultCompare procedure, signed characters} utf8 { set l [lsort [list "abc\u80" "abc"]] |