                                               (contains? #{?loc} location)]]
 
                                             (insert! (->Cold ?temp)))
-        
+
         find-cold (dsl/parse-query [] [[?c <- Cold]])
 
         session (-> (mk-session [temps-for-locations find-cold])

                       (let [results (query session colder-than-mci-query)]

                         (is (= 1 (count results)))
                         
                         (is (= {:?mci-temp 15
                                 :?colder-temps #{(->Temperature 10 "ORD")
                                                  (->Temperature 5 "LGA")}}


                          {:?cold (->Cold 5)})))

(deftest ^{:doc "A test to make sure the appropriate data is held in the memory
                 of accumulate node with join filter is correct upon right-retract."}
  test-accumulator-with-test-join-retract-accumulated-use-new-result
  (let [coldest-temp (dsl/parse-rule [[?thresh <- :temp-threshold]
                                      [?temp <- (acc/max :temperature)
                                       :from [Temperature (< temperature (:temperature ?thresh))]]]

                                     (insert! (->Cold ?temp)))

        find-cold (dsl/parse-query [] [[?c <- Cold]])

        thresh-20 ^{:type :temp-threshold} {:temperature 20}

        temp-10-mci (->Temperature 10 "MCI")
        temp-15-lax (->Temperature 15 "LAX")

