You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
648 B
Clojure
18 lines
648 B
Clojure
(ns com.owoga.frp.infrastructure-test
|
|
(:require [com.owoga.frp.infrastructure :as frp]
|
|
[clojure.test :refer [deftest is testing]]))
|
|
|
|
(deftest test-insert!
|
|
(testing "insert!"
|
|
(let [Offer (frp/->BaseRelVar 'Offer nil (atom #{}))]
|
|
(frp/insert! Offer {:address "123 Fake St." :price 1.5e5})
|
|
(is (= @Offer #{{:address "123 Fake St." :price 1.5e5}})))))
|
|
|
|
(deftest test-project
|
|
(testing "projection"
|
|
(let [Offer (frp/->BaseRelVar 'Offer nil (atom #{}))
|
|
OfferPrices (frp/project Offer [:price])]
|
|
(frp/load! Offer #{{:address "123 Fake St." :price 2e5}})
|
|
(is (= @OfferPrices #{{:price 2e5}})))))
|
|
|