                              [{:name "a"}]
                              query)
                            [:successful package-a30])))
-                    (is (= (resolve-dependencies
-                             [{:name "c"}]
-                             query)
-                           [:successful package-c10]))
+           (is (= (resolve-dependencies
+                    [{:name "c"}]
+                    query)
+                  [:successful package-c10]))
            (testing "Asking for a nonexistent package fails."
                     (is (= (resolve-dependencies
                              [{:name "b"}]

          v)))))

(let  [package-a30
      {:name "a"
       :version 30
       :location "a_loc30"
       :conflicts {"c" nil}
       }
      package-a20
      {:name "a"
       :version 20
       :location "a_loc20"}
      package-c10
      {:name "c"
       :version 10
       :location "c_loc10"}
      package-d22
       {:name "d"
        :version 22
        :location "d_loc22"}
      package-e18
       {:name "e"
        :version 18
        :location "e_loc18"
        :conflicts {"d" nil}}
      repo-info
      {"a"
       [package-a30
        package-a20]
       "c"
       [package-c10]
       "d"
       [package-d22]}
       query (map-query repo-info)]
  (deftest retrieval
           (testing "Asking for a present package succeeds."

                             query
                             :already-installed {"a" 30})
                           [:successful]))))
(deftest conflicts
         (testing (str "Find a package which conflicts with another "
                       "package also to be installed.")
                  (is (= (resolve-dependencies
                           [{:name "d"}
                            {:name "e"}]
                           query)
                         [:unsatisfiable "e"])))
         (testing (str "Find a package which conflicts with a package "
                       "marked a priori as conflicting.")
                  (is (= (resolve-dependencies
                           [{:name "a"}
                            {:name "d"}]
                           query
                           :conflicts {"d" nil})
                         [:unsatisfiable "d"])))
         (testing (str "Find a package which conflicts with a package "
                       "marked a priori as conflicting with something "
                       "already installed.")
                  (is (= (resolve-dependencies
                           [{:name "d"}]
                           query
                           :already-installed {"a" 11}
                           :conflicts {"d" nil})
                         [:unsatisfiable "d"])))

         (testing (str "Find a package which conflicts with another "
                       "package but not at its current version")
                  (is (= (resolve-dependencies
                           [{:name "d"}]
                           query
                           :conflicts {"d" #(< % 22)})
                         [:successful package-d22])))))

(deftest requires
         (let [package-a
