Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enlighten deftest forms #382

Open
ryfow opened this issue Oct 27, 2016 · 1 comment
Open

enlighten deftest forms #382

ryfow opened this issue Oct 27, 2016 · 1 comment
Labels

Comments

@ryfow
Copy link
Contributor

ryfow commented Oct 27, 2016

Enlighten mode doesn't work with deftest forms because deftest puts the test code in the var's metadata and puts a call to test-var in the fn body.

I think this can be resolved with something like what the debugger does but I can't say I really understand what's going on there.

Expected behavior

deftest forms that are evalled with enlighten-mode on would show enlighten info when run.

Actual behavior

enlighten info is not shown

Steps to reproduce the problem

Step 1: Write some code like this:

(require '[clojure.test :refer :all])

(defn not-a-test []
  (let [a (System/currentTimeMillis)]
    (is (= 0 (mod a 3)))))

(deftest a-test
  (let [a (System/currentTimeMillis)]
    (is (= 0 (mod a 3)))))

Step 2: Turn on enlighten mode and eval both forms

Step 3: Run (not-a-test) and (a-test)

See that enlighten displayed the value of a for not-a-test but did not for a-test

Environment & Version information

cider-nrepl version

0.14.0

Java version

1.8

Operating system

Mac OS X

@Malabarba
Copy link
Member

Yes, the debugger needed some special handling in order to support deftest forms, so enlighten will probably require something like that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants