Skip to content

Commit

Permalink
added type preservation tests, refs #8
Browse files Browse the repository at this point in the history
  • Loading branch information
alandipert committed Apr 12, 2016
1 parent 3aa6521 commit 97a8024
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/alandipert/storage_atom/test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@
(is (= (get-in @a3 [:x :y :z]) 42))
(is (= (:some (meta a3)) :metadata)))


(def a4 (local-storage
(atom {:xs [1 2 3]})
"k4"))

(deftest test-collection-types-preserved
(swap! a4 update :xs conj 4)
(is (= (peek (get @a4 :xs)) 4))
(swap! a4 assoc :ys [#{1 2 3}])
(is (vector? (get @a4 :ys)))
(is (set? (first (get @a4 :ys))))
(is (= (get a4 :ys [#{1 2 3}]))))

0 comments on commit 97a8024

Please sign in to comment.