Skip to content

Commit

Permalink
failing test case for #255
Browse files Browse the repository at this point in the history
  • Loading branch information
opqdonut committed Oct 11, 2024
1 parent 036ba67 commit e31461d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/cljc/spec_tools/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -818,15 +818,25 @@

(deftest issue-179
(testing "st/coerce can work properly with s/or specs"
(let [chevy {:doors 4}]
(let [chevy {:doors 4}
bike {:wheels 2}]
(is (= (st/coerce ::car chevy st/strip-extra-keys-transformer)
{:doors 4}))
(is (= (st/coerce ::bike bike st/strip-extra-keys-transformer)
{:wheels 2}))
(is (= (st/coerce ::vehicle chevy st/strip-extra-keys-transformer)
{:doors 4}))

;; TODO: fails!
(is (= (st/coerce ::vehicle bike st/strip-extra-keys-transformer)
{:wheels 2}))

(is (= (st/coerce ::new-vehicle {:rodas [1 "1" 3]} st/strip-extra-keys-transformer)
{:rodas #{1 "1" 3}}))
(is (= (st/coerce ::s {:keyword "a" :date "2020-02-22"} st/json-transformer)
{:keyword :a :date #inst "2020-02-22T00:00:00.000-00:00"})))))
{:keyword :a :date #inst "2020-02-22T00:00:00.000-00:00"}))
(is (= (st/coerce ::s {:keyword "b" :int 3} st/json-transformer)
{:keyword :b :int 3})))))

(s/def ::foo string?)
(s/def ::bar string?)
Expand Down

0 comments on commit e31461d

Please sign in to comment.