;; lib/minikanren/tests/pairlisto.sx — zip two lists into pair list.

(mk-test
  "pairlisto-empty"
  (run* q (pairlisto (list) (list) q))
  (list (list)))

(mk-test
  "pairlisto-equal-lengths"
  (run*
    q
    (pairlisto (list 1 2 3) (list :a :b :c) q))
  (list
    (list (list 1 :a) (list 2 :b) (list 3 :c))))

(mk-test
  "pairlisto-recover-l1"
  (run*
    q
    (pairlisto
      q
      (list :a :b :c)
      (list (list 10 :a) (list 20 :b) (list 30 :c))))
  (list (list 10 20 30)))

(mk-test
  "pairlisto-recover-l2"
  (run*
    q
    (pairlisto
      (list 1 2 3)
      q
      (list (list 1 :x) (list 2 :y) (list 3 :z))))
  (list (list :x :y :z)))

(mk-test
  "pairlisto-different-lengths-fails"
  (run* q (pairlisto (list 1 2) (list :a :b :c) q))
  (list))

(mk-tests-run!)
