diff options
Diffstat (limited to 'tests/lsort.test')
-rw-r--r-- | tests/lsort.test | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/tests/lsort.test b/tests/lsort.test index ca2fc49..5808b89 100644 --- a/tests/lsort.test +++ b/tests/lsort.test @@ -149,9 +149,12 @@ test lsort-3.9 {SortCompare procedure, -integer option} { test lsort-3.10 {SortCompare procedure, -integer option} { list [catch {lsort -integer {3 q}} msg] $msg } {1 {expected integer but got "q"}} -test lsort-3.11 {SortCompare procedure, -integer option} { +# JimTCL specifically does not adhere to the octal default for numbers starting with zero +test lsort-3.11 {SortCompare procedure, -integer option} -constraints jim -body { lsort -integer {35 21 0x20 30 023 100 8} -} {8 21 023 30 0x20 35 100} +} -result {8 21 023 30 0x20 35 100} + + test lsort-3.15 {SortCompare procedure, -command option} { proc cmp {a b} { error "comparison error" @@ -176,9 +179,11 @@ test lsort-3.18 {SortCompare procedure, -command option} { } lsort -command cmp {48 6 18 22 21 35 36} } {48 36 35 22 21 18 6} -test lsort-3.19 {SortCompare procedure, -decreasing option} { +# JimTCL specifically does not adhere to the octal default for numbers starting with zero +test lsort-3.19 {SortCompare procedure, -decreasing optio} -constraints jim -body { lsort -decreasing -integer {35 21 0x20 30 023 100 8} -} {100 35 0x20 30 023 21 8} +} -result {100 35 0x20 30 023 21 8} + test lsort-3.20 {SortCompare procedure, -real option} -body { lsort -real {6...4 3} } -returnCodes error -result {expected floating-point number but got "6...4"} @@ -198,24 +203,8 @@ test lsort-3.22 {lsort, unique sort with index} { } {0 4 5} test lsort-4.26 {DefaultCompare procedure, signed characters} utf8 { - set l [lsort [list "abc\u80" "abc"]] - set viewlist {} - foreach s $l { - set viewelem "" - set len [string length $s] - for {set i 0} {$i < $len} {incr i} { - set c [string index $s $i] - scan $c %c d - if {$d > 0 && $d < 128} { - append viewelem $c - } else { - append viewelem "\\[format %03o [expr {$d & 0xff}]]" - } - } - lappend viewlist $viewelem - } - set viewlist -} [list "abc" "abc\\200"] + lsort [list "abc\u80" "abc"] +} [list "abc" "abc\u80"] test lsort-5.1 "Sort case insensitive" { lsort -nocase {ba aB aa ce} |