improve compact test

This commit is contained in:
nathanmarz 2017-12-21 22:32:30 -05:00
parent 7b646ca566
commit b1050b910c

View file

@ -1668,7 +1668,7 @@
(is (= {} (setval [:a (s/compact :b :c)] s/NONE {:a {:b {:c 1}}})))
(is (= {:a {:d 2}} (setval [:a (s/compact :b :c)] s/NONE {:a {:b {:c 1} :d 2}})))
(let [TREE-VALUES (recursive-path [] p (s/if-path vector? [(s/compact s/ALL) p] s/STAY))
tree [1 [2 3] [4 [[5] [[6]]]]]]
tree [1 [2 3] [] [4 [[5] [[6]]]]]]
(is (= [2 4 6] (select [TREE-VALUES even?] tree)))
(is (= [1 [3] [[[5]]]] (setval [TREE-VALUES even?] s/NONE tree)))
)