Skip to content

Commit 2f73857

Browse files
committed
CLJS-2888: Printing of spec problems buries the failing predicate which should be more prominent
1 parent 3e28f7b commit 2f73857

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/main/cljs/cljs/spec/alpha.cljs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,15 @@
222222
(with-out-str
223223
;;(prn {:ed ed})
224224
(doseq [{:keys [path pred val reason via in] :as prob} problems]
225-
(when-not (empty? in)
226-
(print "In:" (pr-str in) ""))
227-
(print "val: ")
228225
(pr val)
229-
(print " fails")
230-
(when-not (empty? via)
231-
(print " spec:" (pr-str (last via))))
226+
(print " - failed: ")
227+
(if reason (print reason) (pr (abbrev pred)))
228+
(when-not (empty? in)
229+
(print (str " in: " (pr-str in))))
232230
(when-not (empty? path)
233-
(print " at:" (pr-str path)))
234-
(print " predicate: ")
235-
(pr (abbrev pred))
236-
(when reason (print ", " reason))
231+
(print (str " at: " (pr-str path))))
232+
(when-not (empty? via)
233+
(print (str " spec: " (pr-str (last via)))))
237234
(doseq [[k v] prob]
238235
(when-not (#{:path :pred :val :reason :via :in} k)
239236
(print "\n\t" (pr-str k) " ")

0 commit comments

Comments
 (0)