Permalink
Browse files

Updated test cases

  • Loading branch information...
1 parent 21cde07 commit 222ade6869e10ee2a76bf5fce5335b3a853e0896 @straszheimjeffrey straszheimjeffrey committed Mar 7, 2009
Showing with 22 additions and 0 deletions.
  1. +3 −0 src/clojure/contrib/datalog/example.clj
  2. +19 −0 src/clojure/contrib/datalog/tests/test_softstrat.clj
@@ -109,5 +109,8 @@
(def wp-3 (build-work-plan rules (?- :bj :name '??name :boss ?x)))
(run-work-plan wp-3 db {'??name "Albert"})
+(def wp-4 (build-work-plan rules (?- :works-for :employee ?x :boss ?y)))
+(run-work-plan wp-4 db {})
+
;; End of file
@@ -206,6 +206,25 @@
(is (= (evaluate-3 "Albert")
#{{:name "Albert", :boss "Sameer"}})))
+(def ws-4 (build-soft-strat-work-plan rules (?- :works-for :name ?x :boss ?x)))
+
+(deftest test-ws-4
+ (is (= (set (evaluate-soft-work-set ws-4 db {}))
+ #{{:employee "Miki", :boss "Bob"}
+ {:employee "Albert", :boss "Li"}
+ {:employee "Lilian", :boss "Sameer"}
+ {:employee "Li", :boss "Bob"}
+ {:employee "Lilian", :boss "Bob"}
+ {:employee "Brenda", :boss "Fred"}
+ {:employee "Fred", :boss "Bob"}
+ {:employee "John", :boss "Bob"}
+ {:employee "John", :boss "Mary"}
+ {:employee "Albert", :boss "Sameer"}
+ {:employee "Sameer", :boss "Bob"}
+ {:employee "Albert", :boss "Bob"}
+ {:employee "Brenda", :boss "Bob"}
+ {:employee "Mary", :boss "Bob"}
+ {:employee "Li", :boss "Sameer"}})))
(comment
(run-tests)

0 comments on commit 222ade6

Please sign in to comment.