                 :conflicts {"d" [#(< (:version %) 22)]})
                [:successful #{package-d22}]))))))
 
-
-#_(deftest ^:resolve-basic requires
+(deftest ^:resolve-basic requires
     (let [package-a
-          {:id "a"
-           :version 30
-           :location "a_loc30"
-           :requires [{:id "b"}]}
+          (->package
+            "a"
+            30
+            "a_loc30"
+            [
+             [(present "b")]
+             ])
           package-b
-          {:id "b"
-           :version 20
-           :location "b_loc20"}
+          (->package
+            "b"
+            20
+            "b_loc20"
+            nil)
           repo-info
           {"a" [package-a]
            "b" [package-b]}

          query (map-query repo-info)]
      (testing (str "A package having dependencies rejected a priori "
                    "also gets rejected")
        (is (= (resolve-dependencies
                [{:id "a"}
                 {:id "b"}]
                query
                :conflicts {"c" nil})
               [:unsuccessful ["b" "c"]])))))

#_(deftest ^:resolve-basic no-locking
    (testing (str "Find two packages, even when the preferred version "

      (testing (str "One package should require another and both "
                    "should be found.")
        (is (= (resolve-dependencies
                 [
                  [(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
                 [
                  [(present "a")]
                  ]
                query
                :present-packages {"b" package-b})
               [:successful #{package-a}]))))
    (let [package-a
          (->package
            "a"
            10
            "a_loc10"
            nil)
          package-b
          (->package
            "b"
            20
            "b_loc20"
            [
             [(present "c")]
             ])
          package-c
          (->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.")
        (let [aclause [(present "a")]
              bclause [(present "b")]]
        (is (= (resolve-dependencies
                 [
                  aclause
                  bclause
                  ]
                query)
               [:unsuccessful aclause])))))
    (let [package-a
          {:id "a"
           :version 10
