     (is (= {:set 11} @a-base))
     (is (= runs (running)))))
 
+
+(deftest test-equality
+  (let [a (atom {:foo "bar"})
+        a1 (atom {:foo "bar"})
+        c (r/cursor [:foo] a)
+        c2 (r/cursor [:foo] a swap! a assoc :foo)
+        c3 (r/cursor [:foo] a swap! a assoc :foobar)]
+    (is (= @c "bar"))
+    (is (= @c2 "bar"))
+    (is (= @c3 "bar"))
+    (is (= c (r/cursor [:foo] a)))
+    (is (not= c (r/cursor [:foo] a1)))
+    (is (not= c (r/cursor [:foobar] a)))
+    (is (= c2 (r/cursor [:foo] a swap! a assoc :foo)))
+    (is (not= c2 (r/cursor [:foo] a swap! a assoc :foobar)))
+    (is (not= c2 (r/cursor [:foo] a1 swap! a assoc :foo)))
+    (is (not= c2 (r/cursor [:foo] a swap! a1 assoc :foo)))
+
+    (reset! c2 "foobar")
+    (is (= @c2 "foobar"))
+    (is (= @c "foobar"))
+    (is (= @a {:foo "foobar"}))
+
+    (reset! c "bar")
+    (is (= @c2 "bar"))
+    (is (= @c "bar"))
+    (is (= @a {:foo "bar"}))
+    (is (= c (r/cursor [:foo] a)))
+    (is (= c2 (r/cursor [:foo] a swap! a assoc :foo)))
+
+    (reset! c3 "foo")
+    (is (= @a {:foo "bar" :foobar "foo"}))))

                   [reagent.ratom :refer [run! reaction]]
                   [reagent.debug :refer [dbg]])
  (:require [cemerick.cljs.test :as t]
            [reagent.ratom :as rv]))

;; this repeats all the atom tests but using cursors instead


    (let [!x-base (rv/atom {:a {:b 0 :c {:d 0}}})
          !x (rv/cursor [:a :c :d] !x-base)
          !co (rv/make-reaction #(inc @!x) :auto-run true)]
      (is (= 1 @!co) "CO has correct value on first deref")
      (swap! !x inc)
      (is (= 2 @!co) "CO auto-updates")
      (is (= {:a {:b 0 :c {:d 1}}} @!x-base))
      (dispose !co))
