Login
7 branches 0 tags
Ben (Win10) Added some string tests 7bdccf7 3 years ago 765 Commits
nujel / tests / fast / list-sort.nuj
#!/usr/bin/env nujel

[defn test-sort [times sort-func]
       [def l #nil]
       [dotimes [i times]
                [set! l [cons [random/rng!] l]]]
       [def sorted [sort-func l]]
       [while sorted
              [when [and [cadr sorted]
                         [> [car sorted] [cadr sorted]]]
                    [throw :list-not-sorted]]
              [cdr! sorted]]]

[test-sort 1500 list/sort/merge]
[return :success]