From 73380285fac00fe416140e199794db8e074694ff Mon Sep 17 00:00:00 2001 From: Evan Hunter Date: Tue, 23 Feb 2016 23:01:24 +0000 Subject: lsort test: allow unstable lsort implementation to return results of same value in different orders. --- tests/lsort.test | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') 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"]] -- cgit v1.1