Skip to content

Commit

Permalink
Clearer submap test
Browse files Browse the repository at this point in the history
  • Loading branch information
aroemers committed Feb 16, 2024
1 parent 5ba6858 commit ecc063e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/redelay/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

(test/use-fixtures :each ensure-stop)

(defn submap? [a b]
(= a (select-keys b (keys a))))

(deftest simple-test
(let [foo (state 1)
bar (state :start (inc @foo) :name bar)
Expand Down Expand Up @@ -45,8 +48,7 @@
(is (= "bar" (name bar)))
(is (= "baz" (name baz)))

(is (= {:private true, :dynamic true, :defstate true}
(select-keys (meta #'baz) [:private :dynamic :defstate])))
(is (submap? {:private true, :dynamic true, :defstate true} (meta #'baz)))
(is (= {:dev true} (meta baz)))
(is (= {:dev false} (alter-meta! baz update :dev not)))
(is (= {:answer 42} (reset-meta! baz {:answer 42})))))
Expand Down

0 comments on commit ecc063e

Please sign in to comment.