Created
April 27, 2018 12:57
-
-
Save bhb/d8de0dd2bd046124c57131cb8e49da36 to your computer and use it in GitHub Desktop.
Expound printing mimimized failing input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[expound.alpha :as expound] '[clojure.spec.test.alpha :as st] '[clojure.spec.alpha :as s]) | |
(s/fdef foo :args (s/cat :x pos-int?) :ret (s/int-in 0 5)) | |
(defn foo [x] x) | |
(set! s/*explain-out* expound/printer) | |
(expound/explain-results (st/check `foo)) | |
;;== Checked user/foo ========================= | |
;; | |
;;-- Function spec failed ----------- | |
;; | |
;; (user/foo 5) | |
;; | |
;;returned an invalid value. | |
;; | |
;; 5 | |
;; | |
;;should satisfy | |
;; | |
;; (fn [%] (clojure.spec.alpha/int-in-range? 0 5 %)) | |
;; | |
;;------------------------- | |
;;Detected 1 error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment