Last active
January 27, 2016 18:41
-
-
Save cigitia/29497174e19d71ccec51 to your computer and use it in GitHub Desktop.
om.next db->tree underscore test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest db->tree-underscore-test | |
(let [db {:x {nil {:a 2, :b 3}} | |
:y {:a 2, :b 3}}] | |
(is (= (om/db->tree '[{[:x nil] [:a :b]}] db db) | |
{[:x nil] {:a 2, :b 3}}) | |
"X1") | |
(is (= (om/db->tree '[[:x nil]] db db) | |
{[:x nil] {:a 2, :b 3}}) | |
"X2") | |
(is (= (om/db->tree '[:a :b] '[:x nil] db) | |
{:a 2, :b 3}) | |
"X3") | |
(is (= (om/db->tree '[{[:y _] [:a :b]}] db db) | |
{:y {:a 2, :b 3}}) | |
"Y1") | |
(is (= (om/db->tree '[[:y _]] db db) | |
{:y {:a 2, :b 3}}) | |
"Y2") | |
(is (= (om/db->tree '[:a :b] '[:y _] db) | |
{:a 2, :b 3}) | |
"Y3"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment