diff --git a/src/clojure/lazytest/filter.clj b/src/clojure/lazytest/filter.clj index cb09f1d..ba725b0 100644 --- a/src/clojure/lazytest/filter.clj +++ b/src/clojure/lazytest/filter.clj @@ -87,10 +87,10 @@ [ns-suite config] (let [var-filter (map (comp symbol namespace) (:var-filter config)) ns-filter (not-empty (into #{} (concat var-filter (:ns-filter config))))] - (when (and ns-filter - (ns-filter (:doc ns-suite))) - (filter-suite ns-suite config)) - (filter-suite ns-suite config))) + (if ns-filter + (when (ns-filter (:doc ns-suite)) + (filter-suite ns-suite config)) + (filter-suite ns-suite config)))) (defmethod filter-tree :lazytest/run filter-tree--lazytest-run diff --git a/src/clojure/lazytest/main.clj b/src/clojure/lazytest/main.clj index 71ceb33..41db606 100644 --- a/src/clojure/lazytest/main.clj +++ b/src/clojure/lazytest/main.clj @@ -3,7 +3,6 @@ (:gen-class) (:require [clojure.java.io :as io] - [clojure.set :as set] [clojure.tools.namespace.file :refer [read-file-ns-decl]] [clojure.tools.namespace.find :refer [find-sources-in-dir]] [lazytest.cli :refer [validate-opts]] @@ -13,18 +12,12 @@ [lazytest.runner :refer [run-tests]] [lazytest.watch :as watch])) -(defn find-ns-decls [config dirs] - (let [var-filter-nses (->> (:var-filter config) - (map (comp symbol namespace)) - (into #{})) - ns-filter (or (not-empty (set/union (:ns-filter config) var-filter-nses)) - any?)] - (into [] - (comp (mapcat find-sources-in-dir) - (keep read-file-ns-decl) - (keep second) - (filter ns-filter)) - dirs))) +(defn find-ns-decls [dirs] + (into [] + (comp (mapcat find-sources-in-dir) + (keep read-file-ns-decl) + (keep second)) + dirs)) (defn add-md-tests [config dirs] @@ -39,7 +32,7 @@ (defn require-dirs [config dir] (let [dirs (map io/file (or dir #{"test"})) md-nses (add-md-tests config dirs) - nses (into (find-ns-decls config dirs) + nses (into (find-ns-decls dirs) md-nses)] (when (empty? nses) (throw (ex-info "No namespaces to run" {:dir dir}))) diff --git a/test/clojure/lazytest/find_test.clj b/test/clojure/lazytest/find_test.clj index ab73e07..9ddc523 100644 --- a/test/clojure/lazytest/find_test.clj +++ b/test/clojure/lazytest/find_test.clj @@ -16,8 +16,7 @@ (vreset! output (with-out-str-data-map (main/run ["--dir" "corpus/find_tests" "--output" "nested*"])))) - (after (remove-ns 'find-tests.examples) - (vreset! output nil))]} + (after (vreset! output nil))]} (it "runs all suites" (expect (match?