2018-02-15 10:14:56 -05:00
|
|
|
USING: kernel sequences sorting.quick tools.test ;
|
2014-06-09 14:17:07 -04:00
|
|
|
|
2014-06-10 19:45:41 -04:00
|
|
|
{ { } } [ { } dup natural-sort! ] unit-test
|
|
|
|
{ { 1 } } [ { 1 } dup natural-sort! ] unit-test
|
|
|
|
{ { 1 2 3 4 5 } } [ { 1 4 2 5 3 } dup natural-sort! ] unit-test
|
|
|
|
|
|
|
|
{
|
|
|
|
{ "dino" "fred" "wilma" "betty" "barney" "pebbles" "bamm-bamm" }
|
|
|
|
} [
|
|
|
|
{ "fred" "wilma" "pebbles" "dino" "barney" "betty" "bamm-bamm" }
|
|
|
|
dup [ length ] sort-with!
|
|
|
|
] unit-test
|