;; lib/minikanren/tests/arith-prog.sx — arithmetic progression generation.

(mk-test
  "arith-progo-zero-len"
  (run* q (arith-progo 5 1 0 q))
  (list (list)))

(mk-test
  "arith-progo-1-to-5"
  (run* q (arith-progo 1 1 5 q))
  (list (list 1 2 3 4 5)))

(mk-test
  "arith-progo-evens-from-0"
  (run* q (arith-progo 0 2 5 q))
  (list (list 0 2 4 6 8)))

(mk-test
  "arith-progo-descending"
  (run* q (arith-progo 10 -1 4 q))
  (list (list 10 9 8 7)))

(mk-test
  "arith-progo-zero-step"
  (run* q (arith-progo 7 0 3 q))
  (list (list 7 7 7)))

(mk-test
  "arith-progo-negative-start"
  (run* q (arith-progo -3 2 4 q))
  (list (list -3 -1 1 3)))

(mk-tests-run!)
