ghostwheel icon indicating copy to clipboard operation
ghostwheel copied to clipboard

I can't for the life of me figure out how to get tracing to work

Open saikyun opened this issue 6 years ago • 2 comments

With this code:

(ns showcase.ghostwheel
  (:require
   [ghostwheel.tracer]
   [ghostwheel.core :as g :refer [>defn | =>]]))

(>defn ^::g/trace ranged-rand
  "I was lifted straight from the clojure.spec guide"
  [start end]
  [int? int? | #(< start end)
   => int? | #(>= % start) #(< % end)]
  (+ start (long (rand (- end start)))))

(g/check)

And the following in my shadow-cljs.edn:

{:compiler-options
  :ghostwheel 
  {:check true 
   :num-tests 10 
   :outstrument true
   :report-output :repl}}

The automatic tests works great! So thanks for that.

However, I can't figure out how to get tracing to work. Am I missing anything?

In the readme, there's an example that looks like this:

(g/check #(foo 2 4))

But when I try similar code, I get a spec error, saying that g/check won't take that input.

saikyun avatar Nov 22 '19 16:11 saikyun

👋 Hi. I'm posting this same comment to all issue threads to just give a quick heads up that the project, despite rumours and some evidence to the contrary, is not dead. It was hibernating for a little while and now nearing the long-awaited next release, which will fix some long-standing issues (and introduce some breaking changes to the config).

I'll be reviewing all open issues and PRs over the next couple of weeks, so stay tuned and thanks for the patience.

See also this Slack thread

gnl avatar May 21 '20 01:05 gnl