tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Fix run test under cursor in tests with metadata #275

Closed nberger closed 6 years ago

nberger commented 8 years ago

The pattern used to find the test under cursor fails to match when the deftest has metadata in the test var, like in (deftest ^:slow slow-test). Upon failure, it continues searching backwards, usually matching a previous deftest or any other def

The matching is fixed by adding an optional non-capturing group that matches metadata added as ^:some-metadata. Other ways to add metadata (type-hint or metadata map) will still make the pattern to fail, however they are not very common when metadata is added to a test var.

tpope commented 6 years ago

This fell through the cracks, but if it's still an issue I can take another look. I see an unescaped + that breaks the regexp.

nberger commented 6 years ago

Thanks @tpope. I'm pretty sure it is still an issue (albeit not a very frequent one; I haven't seen many people putting metadata on the test vars like this, it's usually on the ns). However, I don't have the time to work on it at the moment. I'm leaving the changes in my fork, in case anyone wants to take it further.