Comments (9)
@arichiardi Thanks for reporting this! Just to make sure I understand the repro, do you mind pasting the call that triggered this? Was it an instrumented function call?
from expound.
@arichiardi Thanks again for reporting this! I'm unable to repro, so I suspect I'm not doing the repro steps correctly 😄
Here is what I tried on the REPL with Expound 0.4.0
(require '[clojure.spec.alpha :as s])
(require '[clojure.spec.test.alpha :as st])
(require '[expound.alpha :as expound])
(set! s/*explain-out* expound/printer)
(st/instrument)
(s/def :stm/success-state (s/tuple #{:start :end :latest-event :attempt-commit}
any?
nil?))
(expound/expound :stm/success-state [:error nil {}])
And I got
-- Spec failed --------------------
[:error ... ...]
^^^^^^
should be one of: `:latest-event`,`:start`,`:attempt-commit`,`:end`
-- Relevant specs -------
:stm/success-state:
(clojure.spec.alpha/tuple
#{:latest-event :start :attempt-commit :end}
clojure.core/any?
clojure.core/nil?)
-- Spec failed --------------------
[... ... {}]
^^
should satisfy
nil?
-- Relevant specs -------
:stm/success-state:
(clojure.spec.alpha/tuple
#{:latest-event :start :attempt-commit :end}
clojure.core/any?
clojure.core/nil?)
-------------------------
Detected 2 errors
I tried on Clojure 1.9.0 and Clojurescript 1.9.946. Are you on different versions?
from expound.
Oh ok the test seems fine, thanks for trying it out!
The only difference is that I am running on lumo
, so maybe that is why the errors are reported differently.
from expound.
@arichiardi Interesting! I haven't tried it on lumo, so I'll need to look into that. I haven't had a chance to use lumo much - is there a relevant config file you can share that sets up the version of Expound and Clojurescript?
from expound.
Not at the keyboard now but probably I should check what expound
relies on and check if lumo provides it correctly
from expound.
The script you tried up there basically works the same with lumo, you could just:
$ lumo script.cljs
It should work, make sure you install the latest:
npm install -g [email protected]
https://www.npmjs.com/package/lumo-cljs
from expound.
@arichiardi Unfortunately, I'm still having trouble reproducing. Here are my steps:
npm install -g [email protected]
- Run script in lumo:
lumo -c ~/.m2/repository/org/clojure/test.check/0.9.0/test.check-0.9.0.jar:~/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:~/.m2/repository/expound/expound/0.4.0/expound-0.4.0.jar
Lumo 1.8.0-beta
ClojureScript 1.9.927
Node.js v8.5.0
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Exit: Control+D or :cljs/quit or exit
cljs.user=> (require '[clojure.spec.alpha :as s])
nil
cljs.user=> (require '[clojure.spec.test.alpha :as st])
nil
cljs.user=> (require '[expound.alpha :as expound])
nil
cljs.user=>
cljs.user=> (st/instrument)
[expound.printer/indent
expound.paths/prefix-path?
expound.alpha/specs
expound.paths/kvps-path?
expound.alpha/value-in-context
expound.printer/pprint-str
expound.paths/kps-path?
expound.problems/summary-form
expound.printer/no-trailing-whitespace]
cljs.user=>
cljs.user=> (set! s/*explain-out* expound/printer)
#object[expound$alpha$printer]
cljs.user=>
cljs.user=> (s/def :stm/success-state (s/tuple #{:start :end :latest-event :attempt-commit}
#_=> any?
#_=> nil?))
:stm/success-state
cljs.user=>
cljs.user=> (expound/expound :stm/success-state [:error nil {}])
-- Spec failed --------------------
[:error ... ...]
^^^^^^
should be one of: `:start`,`:end`,`:latest-event`,`:attempt-commit`
-- Relevant specs -------
:stm/success-state:
(cljs.spec.alpha/tuple
#{:start :end :latest-event :attempt-commit}
cljs.core/any?
cljs.core/nil?)
-- Spec failed --------------------
[... ... {}]
^^
should satisfy
nil?
-- Relevant specs -------
:stm/success-state:
(cljs.spec.alpha/tuple
#{:start :end :latest-event :attempt-commit}
cljs.core/any?
cljs.core/nil?)
-------------------------
Detected 2 errors
nil
Just double checking - are you using Expound 0.4.0?
from expound.
I have tried again and cannot reproduce the original error I tried yours and it is working. I am using s/check-asserts
but it works the same. I will try to observe the situation, we can close this for now and reopen it later. I will try to be more careful and don't create too much noise next time...
from expound.
@arichiardi Yes, if you see this again, please don't hesitate to reopen this issue. I'd love to get this fixed. Thanks for using Expound!
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.