diff --git a/basis/unicode/collation/collation-tests.factor b/basis/unicode/collation/collation-tests.factor index bf87c6b7da..be6af2d920 100644 --- a/basis/unicode/collation/collation-tests.factor +++ b/basis/unicode/collation/collation-tests.factor @@ -11,11 +11,7 @@ IN: unicode.collation.tests : test-two ( str1 str2 -- ) [ +lt+ ] -rot [ string<=> ] 2curry unit-test ; -: failures - parse-test dup 2 - [ string<=> +lt+ = not ] assoc-filter dup assoc-size ; - -: test-equality +: test-equality ( str1 str2 -- ) { primary= secondary= tertiary= quaternary= } [ execute ] with with each ; diff --git a/basis/unicode/collation/collation.factor b/basis/unicode/collation/collation.factor index 8e9e2963a8..65786ede5d 100644 --- a/basis/unicode/collation/collation.factor +++ b/basis/unicode/collation/collation.factor @@ -100,8 +100,8 @@ ducet insert-helpers ] { } map-as concat ; : append-weights ( weights quot -- ) - swap [ ignorable?>> not ] filter - swap map [ zero? not ] filter % 0 , ; + [ [ ignorable?>> not ] filter ] dip + map [ zero? not ] filter % 0 , ; inline : variable-weight ( weight -- ) dup ignorable?>> [ primary>> ] [ drop HEX: FFFF ] if , ; @@ -135,7 +135,7 @@ PRIVATE> @@ -158,8 +158,7 @@ PRIVATE> PRIVATE> : sort-strings ( strings -- sorted ) - [ w/collation-key ] map - natural-sort values ; + [ w/collation-key ] map natural-sort values ; : string<=> ( str1 str2 -- <=> ) [ w/collation-key ] compare ;