You haven't pretty-printed it to look very nice, but I think all of the
same information (and more due to shrinking) is still in the check-var
output. I don't know of any plan to add what you're asking for beyond
what's below.
{:result
{:clojure.spec/problems
{[]
{*:pred* *(>= (:ret %) (-> % :args :start))*,
*:val* *{:args {:start -1, :end 2}, :ret -2}*,
:via [],
:in []}},
* :failed-on :fn*},
:seed 1466016600676,
:failing-size 4,
:num-tests 5,
:fail [(-1 2)],
:shrunk
{:total-nodes-visited 5,
:depth 1,
:result
{:clojure.spec/problems
{[]
{:pred (>= (:ret %) (-> % :args :start)),
:val {:args {:start -1, :end 1}, :ret -2},
:via [],
:in []}},
:failed-on :fn},
:smallest [(-1 1)]}}
On Wednesday, June 15, 2016 at 2:54:27 PM UTC-5, Sean Corfield wrote:
>
> Given that we now have to use clojure.spec.test to get :ret / :fn tested,
> we lose the “nice” exceptions explaining the conformance failure:
>
>
>
> Alpha 5:
>
>
>
> ;;=> ExceptionInfo Call to #'spec-example.core/ranged-rand did not conform
> to spec:
>
> ;;=> At: [:fn] val: {:args {:start 8, :end 10}, :ret 7} fails predicate:
> (>= (:ret %) (-> % :args :start))
>
> ;;=> :clojure.spec/args (8 10)
>
> ;;=> clojure.core/ex-info (core.clj:4617)
>
>
>
> Alpha 6:
>
>
>
> boot.user=> (t/check-var #'ranged-rand)
>
> {:result {:clojure.spec/problems {[] {:pred (>= (:ret %) (-> % :args
> :start)), :val {:args {:start -1, :end 2}, :ret -2}, :via [], :in []}},
> :failed-on :fn}, :seed 1466016600676, :failing-size 4, :num-tests 5, :fail
> [(-1 2)], :shrunk {:total-nodes-visited 5, :depth 1, :result
> {:clojure.spec/problems {[] {:pred (>= (:ret %) (-> % :args :start)), :val
> {:args {:start -1, :end 1}, :ret -2}, :via [], :in []}}, :failed-on :fn},
> :smallest [(-1 1)]}}
>
>
>
> Are there plans to provide an “explain” equivalent for this?
>
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.