Skip to content

Commit

Permalink
sorting: simpler sort-with test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Dec 5, 2024
1 parent d349ec8 commit ecb2270
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/sorting/sorting-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ unit-test

[ { 1 2 } [ 2drop 1 ] sort-with ] must-not-fail
{ { 1 2 3 4 5 6 } } [ { 5 2 6 1 4 3 } [ <=> ] sort-with ] unit-test
{ 3 { 1 2 3 4 5 6 } } [
3 { 5 2 6 1 4 3 }
[ pick dup 3 assert= '[ _ / ] bi@ <=> ] sort-with
] unit-test
{ 3 { 1 2 3 4 5 6 } } [ 3 { 5 2 6 1 4 3 } [ pick 3 assert= <=> ] sort-with ] unit-test

! Is it a stable sort?
{ t } [ { { 1 "a" } { 1 "b" } { 1 "c" } } dup sort-keys = ] unit-test
Expand Down

0 comments on commit ecb2270

Please sign in to comment.