From ecc063e29f77f12c1edcc3061154f2dbc1ab264a Mon Sep 17 00:00:00 2001 From: Arnout Roemers <1654946+aroemers@users.noreply.github.com> Date: Fri, 16 Feb 2024 17:43:36 +0100 Subject: [PATCH] Clearer submap test --- test/redelay/core_test.clj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/redelay/core_test.clj b/test/redelay/core_test.clj index 63d6f96..51b6ab5 100644 --- a/test/redelay/core_test.clj +++ b/test/redelay/core_test.clj @@ -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) @@ -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})))))