-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Fix issues with test runner #764
Comments
Yes, this would be great to improve in the ways you point at. About looking for tests when it is just a |
Sorry, I meant If there is a function defined as I'm not sure if the intention is to find the corresponding test for a |
The intention is to run any tests defined in the metadata of the symbol. So with something like this: (defn abs
"The absolute value of a number."
{:test (fn []
(is (= (Math/abs 5) 5))
(is (= (Math/abs -2) 2))
(is (= (Math/abs 0) 0)))}
[x]
{:pre [(number? x)]}
(if (pos? x)
x
(- x))) Running the current test with the cursor inside this function should run those tests. Indeed, if we could find the corresponding test defined in a deftest, and if we can support
Probably both involve some regex. Maybe if CIDER does the right thing here, we could have a look at how it is done there. |
I see. Thanks for the info. Currently we use the convention Line 121 in 70808a0
|
After fixing an issue with tests not being found, I realized the test runner could use more work than just that fix, such as:
#break
reader tag in the form at the cursor, parsing of the form fails. Then "undefined" is returned, which then leads to another issue - we pass undefined to the test op which then runs all tests found in the namespace. I think we can possibly make the parser not croak on the #break tag by providing a data reader function for it.def
, instead ofdeftest
orwith-test
)with-test
testsThe text was updated successfully, but these errors were encountered: