Fork me on GitHub
#clojure-spec
<
2017-07-08
>
xiongtx02:07:20

Is the file/line/col of spec definitions stored anywhere, as they are for vars when the latter are read? It’d be nice to have that information so we can jump to a spec’s definition.

richiardiandrea06:07:33

@xiongtx there has been some plan for that if I remember correctly, unfortunately I cannot find the reference (I think it was exactly in this channel)

jsselman17:07:00

How can I use the result of clojure.spec.test/check to see if a test failed? The doc seems to hint at checking the value of the :failure key, but that value is false in my test despite there being a clear check error

gfredericks17:07:16

@jsselman is it false or [false]?

jsselman17:07:55

println shows it as false

jsselman17:07:09

I should mention this is ClojureScript not Clojure

gfredericks17:07:41

what's the full return?

jsselman17:07:03

the function call is just (stest/check ``sut/normalize)`

jsselman17:07:36

arg how do i insert a literal backtick

gfredericks17:07:48

the value under [:clojure.test.check/ret :result] should work

gfredericks17:07:11

I have no idea what the failure key is meant to mean

jsselman17:07:17

the value there is false, does that indicate the test failed?

jsselman17:07:23

i guess i can quickly check that

jsselman17:07:39

@gfredericks that does work, thanks!

jsselman17:07:25

The spec guide shows an example using

(stest/abbrev-result (first (stest/check `ranged-rand)))
, but here it loses the failure. Guess I can manually check

jsselman17:07:47

(I get {:sym raytrace-weekend.vec3/normalize, :failure false})