       (testing (str "One package should require another and both "
                     "should be found.")
         (is (= (resolve-dependencies
-                [{:id "a"}]
+                 [
+                  [(present "a")]
+                  ]
                 query)
                [:successful #{package-a package-b}])))
       (testing (str "One package should be found when it requires "
                     "another, but it's already installed.")
         (is (= (resolve-dependencies
-                [{:id "a"}]
+                 [
+                  [(present "a")]
+                  ]
                 query
-                :present-packages {"b" 20})
+                :present-packages {"b" package-b})
                [:successful #{package-a}]))))
     (let [package-a
-          {:id "a"
-           :version 10
-           :location "a_loc30"}
+          (->package
+            "a"
+            10
+            "a_loc10"
+            nil)
           package-b
-          {:id "b"
-           :version 20
-           :location "b_loc20"
-           :requires [{:id "c"}]}
+          (->package
+            "b"
+            20
+            "b_loc20"
+            [
+             [(present "c")]
+             ])
           package-c
-          {:id "c"
-           :version 10
-           :conflicts {"a" nil}}
-
+          (->package
+            "c"
+            10
+            "c_loc10"
+            [
+             [(absent "a")]
+             ])
           repo-info
           {"a" [package-a]
            "b" [package-b]
            "c" [package-c]}
           query (map-query repo-info)]
-      (testing (str "A package having dependencies which conflicts with "
-                    "other packages downloaded should be rejected.")
-        (is (= (resolve-dependencies
-                [{:id "a"}
-                 {:id "b"}]
-                query)
-               [:unsuccessful ["b" "c"]]))))
+      (testing
+        (str "A package having dependencies which conflicts with "
+             "other packages downloaded should be rejected.")
+        (let [aclause [(present "a")]
+              bclause [(present "b")]]
+        (is (= (resolve-dependencies
+                 [
+                  aclause
+                  bclause
+                  ]
+                query)
+               [:unsuccessful aclause])))))
     (let [package-a
           {:id "a"
            :version 10

                :conflicts {"d" [#(< (:version %) 22)]})
               [:successful #{package-d22}]))))))


#_(deftest ^:resolve-basic requires
    (let [package-a
          {:id "a"
           :version 30
           :location "a_loc30"
           :requires [{:id "b"}]}
          package-b
          {:id "b"
           :version 20
           :location "b_loc20"}
          repo-info
          {"a" [package-a]
           "b" [package-b]}

        (let [[k v] result]
          v)))))


;; TODO: disjunctive clause tests

(let  [package-a30
       (->package
