Login
7 branches 0 tags
Ben (X13/Arch) Revert "Code cleanup" 36d335e 2 years ago 971 Commits
nujel / tests / slow / list-slow-sort.nuj
#!/usr/bin/env nujel

(require :random)

(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)

(return :success)