cognitect-labs / test-runner

A test runner for clojure.test
Eclipse Public License 2.0
288 stars 32 forks source link

Respect --namespace filter without setting dummy --namespace-regex #15

Closed mainej closed 6 years ago

mainej commented 6 years ago

Currently, if your project has two test namespaces, a-test and b-test if you call clj -m test.runner --namespace b-test, the tests from both namespaces will run.

This is because the default ns regex #"*-test" allows both namespaces. One fix is to add a dummy regex to the command line: clj -m test.runner --namespace b-test --namespace-regex zzz. But that feels like a hack. This commit prevents the need for the hack.

One criticism of this fix is that it ignores --namespace-regex whenever --namespace is set. To me, this makes sense. But if you expect --namespace-regex and --namespace to apply simultaneously, let me know how you would like them to interact.

levand commented 6 years ago

Clear bug, thanks.