How to run leiningen tests having > (greater than) symbol in their name under Windows?
-
20-12-2019 - |
Question
I can't refer to tests having ->
in its names because >
symbol is treated as stdout redirection.
Under PowerShell 4.0 I run current stable Leiningen 2.4.2 with parameters being escaped by --%
:
PS> lein test :only --% my-project.core/foo->bar
I see only stderr in the console, but as a side-effect I get bar
file created with the following content:
lein test user
Ran 0 tests containing 0 assertions.
0 failures, 0 errors.
Solution
The problem is in lein.bat
file. When %*
gets expanded to all arguments passed on line 303, all my escapes are gone. As a temporary solution I see quoting special symbols with a circumflex (^
) and then quoting all the circumflexes, which is equal to using ^^^
to make it work:
PS> lein test :only my-project.core/foo-^^^>bar
Looks ugly, but it works. If there's a better solution, I'd prefer that one.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow