Comments (6)
@conan Thanks very much for reporting this! It appears to be a bug in Expound.
from expound.
Some changes in 0.7.1-SNAPSHOT make this slightly better - instead of giving an error, expound prints the (confusing, at least to me) error message:
-- Spec failed --------------------
clojure.lang.AFunction/1
should satisfy
map?
or
threw exception
"Assert failed: -- Spec failed --------------------
(nil)
^^^
should satisfy
map?
-------------------------
Detected 1 error
(pvalid? argspec args)"
with args:
{:server-port 1, :server-name "", :remote-addr "", :uri "/", :scheme :http, :protocol "HTTP/1.1", :headers {}, :request-method :a}, clojure.spec.alpha$fspec_impl$reify__2451$fn__2454@68558a2a, clojure.spec.alpha$fspec_impl$reify__2451$fn__2454@13848bf6
-------------------------
Detected 1 error
I'm going to leave this open until I can look into this more.
For reference, a test that reproduces the issue for me:
;; make sure to include [metosin/reitit "0.1.2"]
;; :ring/handler has lots of alternatives in the spec
;; including several possible fdef implementations
(deftest complex-alternatives
;; Repro without reitit
(is (string?
(binding [s/*explain-out* expound/printer]
(s/explain-str :ring/handler (fn [req] {})))))
;; Repro with reitit
(binding [s/*explain-out* expound/printer]
(is (string?
(s/explain-str :ring/handler (rr/ring-handler (rr/router ["" #(prn "")])))))))
from expound.
Hm, this may relate to over-using the internal function predicate-errors
in too many places.
from expound.
Related: ring-clojure/ring-spec#7
from expound.
@conan Thanks for reporting this and sorry for the delayed fix. I've fixed this in the next branch (if you want to try it out, you can try commit e478146). Note that I've also made an improvement to the ring specs (see link above).
Thanks for using Expound!
from expound.
@conan Thanks for reporting this. This fix is included in version 0.8.0, which I've just released.
from expound.
Related Issues (20)
- Error reports returned as :cause string in an exception when produced by instrumentation within generative testing HOT 11
- allow passing options map to expound/expound-str HOT 1
- Improve grouping of spec errors HOT 2
- Unnecessary dependency on `cider-nrepl` HOT 1
- Regression of #3 HOT 4
- Easier editing of error messages
- `printer` has invalid spec HOT 2
- "Cannot convert path" on instrumentation failures in the wild HOT 4
- (cljs.spec.test.alpha/instrument) breaks expound due to wrong arity HOT 4
- should expound work anywhere s/explain works? - clojurescript error HOT 7
- Error in :ret check when using with Orchestra 2020.07.12-1 HOT 5
- Internal error in `lift-singleton-groups` when having a datomic db value in fn args HOT 13
- Crash bug when printing, if a datomic db is present and the spec fails HOT 19
- Feature inquiry: a convenience function for validating a value against a spec HOT 4
- Wrapped `s/keys` does not properly display unqualified keyword specs HOT 5
- ClassCastException from `expound-str` when running in AWS Lambda HOT 9
- Small *print-length* and/or *print-level* sometimes yield NPE HOT 5
- PersistentList cannot be cast to class Named HOT 3
- proposal : defmsg equivalent for arbitrary predicates HOT 15
- optional include location of the spec error in the message. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expound.