Skip to content

Commit

Permalink
CLJS-2888: Printing of spec problems buries the failing predicate whi…
Browse files Browse the repository at this point in the history
…ch should be more prominent
  • Loading branch information
mfikes committed Sep 7, 2018
1 parent 3e28f7b commit 2f73857
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/main/cljs/cljs/spec/alpha.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,15 @@
(with-out-str
;;(prn {:ed ed})
(doseq [{:keys [path pred val reason via in] :as prob} problems]
(when-not (empty? in)
(print "In:" (pr-str in) ""))
(print "val: ")
(pr val)
(print " fails")
(when-not (empty? via)
(print " spec:" (pr-str (last via))))
(print " - failed: ")
(if reason (print reason) (pr (abbrev pred)))
(when-not (empty? in)
(print (str " in: " (pr-str in))))
(when-not (empty? path)
(print " at:" (pr-str path)))
(print " predicate: ")
(pr (abbrev pred))
(when reason (print ", " reason))
(print (str " at: " (pr-str path))))
(when-not (empty? via)
(print (str " spec: " (pr-str (last via)))))
(doseq [[k v] prob]
(when-not (#{:path :pred :val :reason :via :in} k)
(print "\n\t" (pr-str k) " ")
Expand Down

0 comments on commit 2f73857

Please sign in to comment.