;; lib/minikanren/tests/palindromeo.sx — palindromic list relation.

(mk-test
  "palindromeo-empty"
  (run* q (palindromeo (list)))
  (list (make-symbol "_.0")))

(mk-test
  "palindromeo-singleton"
  (run* q (palindromeo (list :a)))
  (list (make-symbol "_.0")))

(mk-test
  "palindromeo-pair-equal"
  (run* q (palindromeo (list 1 1)))
  (list (make-symbol "_.0")))

(mk-test
  "palindromeo-pair-unequal-fails"
  (run* q (palindromeo (list 1 2)))
  (list))

(mk-test
  "palindromeo-five-yes"
  (run*
    q
    (palindromeo
      (list 1 2 3 2 1)))
  (list (make-symbol "_.0")))

(mk-test
  "palindromeo-five-no"
  (run*
    q
    (palindromeo
      (list 1 2 3 4 5)))
  (list))

(mk-test
  "palindromeo-strings"
  (run* q (palindromeo (list "a" "b" "a")))
  (list (make-symbol "_.0")))

(mk-tests-run!)
