Permalink
Browse files

Tests now show how the predc reifier would be used in practice.

  • Loading branch information...
1 parent ff58966 commit 107aa9d13b4e00cd94718fcaf943994e5f282da3 @namin namin committed Jan 20, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/test/clojure/clojure/core/logic/tests.clj
@@ -2583,9 +2583,14 @@
(deftest test-predc-custom-reify-1
(is (= (run* [q]
- (predc q number? (fn [c v r a] `(~'num ~v))))
+ (predc q number? (fn [c v r a] `(~'num ~(walk* r (walk* a q))))))
'((_0 :- (num _0)))))
(is (= (run* [q]
+ (fresh [x y]
+ (predc x number? (fn [c v r a] `(~'num ~(walk* r (walk* a x)))))
+ (== [x y] q)))
+ '(([_0 _1] :- (num _0)))))
+ (is (= (run* [q]
(predc q number? (fn [c v r a] nil)))
'(_0))))

0 comments on commit 107aa9d

Please sign in to comment.