]> gitweb.factorcode.org Git - factor.git/blob - core/sorting/sorting-tests.factor
Refactor binary search
[factor.git] / core / sorting / sorting-tests.factor
1 USING: sorting sequences kernel math math.order random
2 tools.test vectors ;
3 IN: sorting.tests
4
5 [ [ ] ] [ [ ] natural-sort ] unit-test
6
7 [ { 270000000 270000001 } ]
8 [ T{ slice f 270000000 270000002 270000002 } natural-sort ]
9 unit-test
10
11 [ t ] [
12     100 [
13         drop
14         100 [ 20 random [ 1000 random ] replicate ] replicate natural-sort [ before=? ] monotonic?
15     ] all?
16 ] unit-test
17
18 [ ] [ { 1 2 } [ 2drop 1 ] sort drop ] unit-test