Login
7 branches 0 tags
Benjamin Vincent Schulenburg Made binary operations more robust and 64bit 84f8e31 3 years ago 437 Commits
nujel / tests / fast / list-sort.nuj
#!/usr/bin/env nujel

[defun test-sort [times sort-func]
       [def l #nil]
       [for [i 0 times]
            [set! l [cons [random/rng!] l]]]
       [set! 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]