Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(match #{false} #{false}) fails #124

Closed
dchelimsky opened this issue May 27, 2020 · 3 comments
Closed

(match #{false} #{false}) fails #124

dchelimsky opened this issue May 27, 2020 · 3 comments
Labels

Comments

@dchelimsky
Copy link
Contributor

dchelimsky commented May 27, 2020

(core/match #{false} #{false})
;; => {:matcher-combinators.result/type :mismatch,
;;     :matcher-combinators.result/value #{false {:actual false}},
;;     :matcher-combinators.result/weight 1}

Also, because in-any-order uses the same underlying mechanism as set matchers:

(core/match (m/in-any-order [false]) [false])
;; => {:matcher-combinators.result/type :mismatch,
;;     :matcher-combinators.result/value (false {:actual false}),
;;     :matcher-combinators.result/weight 1}
@dchelimsky
Copy link
Contributor Author

FYI - I discovered this adding a property test for the equals matcher:

(defspec equals-matchers
  {:num-tests 100
   :max-size  10}
  (prop/for-all [v gen/any-equatable]
                (core/match?
                 (core/match (matchers/equals v) v))))

;; produces

{:shrunk
 {:total-nodes-visited 11,
  :depth 1,
  :pass? false,
  :result false,
  :result-data nil,
  :time-shrinking-ms 1,
  :smallest [#{false}]},
 :failed-after-ms 13,
 :num-tests 36,
 :seed 1590595380500,
 :fail [#{false \:}],
 :result false,
 :result-data nil,
 :failing-size 5,
 :pass? false,
 :test-var "equals-matchers"}

@dchelimsky dchelimsky added the bug label May 27, 2020
@philomates
Copy link
Collaborator

ha, this is an awesome bug! I'm having fun imagining what the buggy code looks like :)
yay generative tests, was actually wondering how you came across this

@philomates
Copy link
Collaborator

addressed in #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants