Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Aug 27, 2024
1 parent 596cf39 commit 0ab3e9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/malli/generator_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1102,18 +1102,18 @@
["duck" :map]
["boss" :map]]]
(is (every? #{{:type "duck"} {:type "boss"}} (mg/sample schema)))
(is (m/validator schema) (mg/sample schema))))
(is (every? (m/validator schema) (mg/sample schema)))))

(testing "non keyword doesn't accumulate data"
(let [schema [:multi {:dispatch (fn [x] (:type x))}
["duck" :map]
["boss" :map]]]
(is (every? #{{}} (mg/sample schema)))
(is (m/validator schema) (mg/sample schema))))
(is (not (every? (m/validator schema) (mg/sample schema))))))

(testing "::m/default works too"
(let [schema [:multi {:dispatch :type}
["duck" :map]
[::m/default [:= "boss"]]]]
(is (every? #{{:type "duck"} "boss"} (mg/sample schema)))
(is (m/validator schema) (mg/sample schema)))))
(is (every? (m/validator schema) (mg/sample schema))))))

0 comments on commit 0ab3e9b

Please sign in to comment.