athos / Pinpointer

Pinpointer is yet another clojure.spec error reporter based on a precise error analysis
Eclipse Public License 1.0
94 stars 3 forks source link

(pinpoint <predicate> <input>) fails #2

Open athos opened 6 years ago

athos commented 6 years ago
=> (pinpoint integer? :foo)
[PINPOINTER] Failed to analyze the spec errors, and will fall back to s/explain-printer

val: :foo fails predicate: :clojure.spec.alpha/unknown
nil
=> (pinpoint integer? :foo {:fallback-on-error false})

IllegalArgumentException Don't know how to create ISeq from: clojure.core$integer_QMARK_  clojure.lang.RT.seqFrom (RT.java:550)
=>

This is due to CLJ-2068. A workaround for the issue is to wrap the predicate in s/spec:

=> (p/pinpoint (s/spec integer?) :foo)
Detected 1 spec error:
----------------------------------------------------------------------
(1/1)

    Input: :foo
           ^^^^
 Expected: integer?

----------------------------------------------------------------------
nil
=> 
marco-m commented 5 years ago

Update: CLJ-2068 is solved and available in spec.alpha-0.2.168

athos commented 5 years ago

Hi, thank you (again) for pointing it out!

As with #4, spectrace still needs a little more work to make Pinpointer work with these code. So, stay tuned for a little bit while 🙏

marco-m commented 5 years ago

Sure, no problems, and thanks for Pinpointer!