Skip to content

Commit

Permalink
Add test for retaining metadata for polyadic assoc-some
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Oct 7, 2024
1 parent 27228b5 commit 86388bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/medley/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
(is (= (m/assoc-some nil :a 1) {:a 1}))
(is (= (m/assoc-some nil :a 1 :b 2) {:a 1 :b 2}))
(is (nil? (m/assoc-some nil :a nil)))
(is (nil? (m/assoc-some nil :a nil :b nil))))
(is (nil? (m/assoc-some nil :a nil :b nil)))
(let [input (with-meta {:a 1} {:m 42})]
(is (= {:m 42} (meta (m/assoc-some input :b 2 :c nil :d 3))))))

(deftest test-update-existing
(is (= (m/update-existing {:a 1} :a inc) {:a 2}))
Expand Down

0 comments on commit 86388bd

Please sign in to comment.