Git Product home page Git Product logo

Comments (9)

bhb avatar bhb commented on July 22, 2024

@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.

bhb avatar bhb commented on July 22, 2024

@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.

arichiardi avatar arichiardi commented on July 22, 2024

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.

bhb avatar bhb commented on July 22, 2024

@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.

arichiardi avatar arichiardi commented on July 22, 2024

Not at the keyboard now but probably I should check what expound relies on and check if lumo provides it correctly

from expound.

arichiardi avatar arichiardi commented on July 22, 2024

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.

bhb avatar bhb commented on July 22, 2024

@arichiardi Unfortunately, I'm still having trouble reproducing. Here are my steps:

  1. npm install -g [email protected]
  2. 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.

arichiardi avatar arichiardi commented on July 22, 2024

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.

bhb avatar bhb commented on July 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.