Skip to content

Commit

Permalink
Fix bug with st/select-spec and s/or
Browse files Browse the repository at this point in the history
  • Loading branch information
dehli committed Nov 13, 2021
1 parent d05e6e3 commit 28c2a8c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/cljc/spec_tools/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -928,3 +928,18 @@
{:epoch "Epoch converted"
:nano 20
:time-basis :UTC})))))

(s/def ::str-264 string?)
(s/def ::kw-264 keyword?)
(s/def ::map-264 (s/or :str-map (s/keys :req [::str-264])
:kw-map (s/keys :req [::kw-264])))

(deftest issue-264
(doseq [check [{::kw-264 :foo}
{::str-264 "bar"}]]

(testing "specs are valid before calling st/select-spec"
(is (s/valid? ::map-264 check)))

(testing "specs stay valid after calling st/select-spec"
(is (s/valid? ::map-264 (st/select-spec ::map-264 check))))))

0 comments on commit 28c2a8c

Please sign in to comment.