From 1166d8f08dc0ff9ba81ea59b031cc39e4894641b Mon Sep 17 00:00:00 2001
From: metamben <103100869+metamben@users.noreply.github.com>
Date: Tue, 17 Oct 2023 19:28:21 +0300
Subject: [PATCH] Test that metabase.util/assoc-default preserves metadata
 (#34716)

---
 test/metabase/util_test.cljc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/metabase/util_test.cljc b/test/metabase/util_test.cljc
index aa273fa6b52..ea6efcaaf2c 100644
--- a/test/metabase/util_test.cljc
+++ b/test/metabase/util_test.cljc
@@ -410,7 +410,10 @@
            (u/assoc-default {:x nil} :x 0 :y nil :z 1))))
   (testing "multiple defaults for the same key"
     (is (= {:x nil, :y 1, :z 2}
-           (u/assoc-default {:x nil} :x 0, :y nil, :y 1, :z 2, :x 3, :z 4)))))
+           (u/assoc-default {:x nil} :x 0, :y nil, :y 1, :z 2, :x 3, :z 4))))
+  (testing "preserves metadata"
+    (is (= {:m true}
+           (meta (u/assoc-default ^:m {:x 0} :y 1 :z 2 :a nil))))))
 
 (deftest ^:parallel classify-changes-test
   (testing "classify correctly"
-- 
GitLab