;; lib/minikanren/tests/enumerate.sx — index-each-element relation.

(mk-test
  "enumerate-i-empty"
  (run* q (enumerate-i (list) q))
  (list (list)))

(mk-test
  "enumerate-i-three"
  (run* q (enumerate-i (list :a :b :c) q))
  (list
    (list (list 0 :a) (list 1 :b) (list 2 :c))))

(mk-test
  "enumerate-i-strings"
  (run* q (enumerate-i (list "x" "y" "z") q))
  (list
    (list (list 0 "x") (list 1 "y") (list 2 "z"))))

(mk-test
  "enumerate-from-i-100"
  (run* q (enumerate-from-i 100 (list :x :y :z) q))
  (list
    (list (list 100 :x) (list 101 :y) (list 102 :z))))

(mk-test
  "enumerate-from-i-singleton"
  (run* q (enumerate-from-i 0 (list :only) q))
  (list (list (list 0 :only))))

(mk-tests-run!)
