|
6 | 6 | (first (filter #(re-find regexp (:match %)) occurrences))) |
7 | 7 |
|
8 | 8 | (deftest find-macro-test |
9 | | - (let [occurrences (find-macro "com.example.macro-def/my-macro") |
| 9 | + (let [occurrences (find-macro "com.example.macro-def/my-macro" false) |
10 | 10 | {:keys [line-beg col-beg file match]} |
11 | 11 | (first (filter #(.contains (:match %) "defmacro") occurrences))] |
12 | 12 | (testing "finds the macro definition" |
|
29 | 29 | (is (.endsWith file "macro_def.clj"))))) |
30 | 30 |
|
31 | 31 | (deftest find-regular-symbol-test |
32 | | - (is (nil? (find-macro "sym")))) |
| 32 | + (is (nil? (find-macro "sym" false)))) |
33 | 33 |
|
34 | 34 | (deftest find-fully-qualified-random-name |
35 | | - (is (nil? (find-macro "asdf")))) |
| 35 | + (is (nil? (find-macro "asdf" false)))) |
36 | 36 |
|
37 | 37 | (deftest find-fully-qualified-fn |
38 | | - (is (nil? (find-macro "refactor-nrepl.find.find-macros/find-macro")))) |
| 38 | + (is (nil? (find-macro "refactor-nrepl.find.find-macros/find-macro" false)))) |
39 | 39 |
|
40 | 40 | (deftest finds-macro-defined-in-cljc-file |
41 | 41 | (is (found? #"defmacro cljc-macro" |
42 | | - (find-macro "com.example.macro-def-cljc/cljc-macro")))) |
| 42 | + (find-macro "com.example.macro-def-cljc/cljc-macro" false)))) |
43 | 43 |
|
44 | 44 | (deftest finds-macro-defined-in-cljc-file-and-used-in-clj-file |
45 | 45 | (is (found? #"(com.example.macro-def-cljc/cljc-macro :fully-qualified)" |
46 | | - (find-macro "com.example.macro-def-cljc/cljc-macro")))) |
| 46 | + (find-macro "com.example.macro-def-cljc/cljc-macro" false)))) |
47 | 47 |
|
48 | 48 | (deftest macro-definitions-are-cached |
49 | | - (find-macro "com.example.macro-def/my-macro") |
| 49 | + (find-macro "com.example.macro-def/my-macro" false) |
50 | 50 | (with-redefs [refactor-nrepl.find.find-macros/put-cached-macro-definitions |
51 | 51 | (fn [& _] (throw (ex-info "Cache miss!" {})))] |
52 | | - (is (found? #"defmacro my-macro" (find-macro "com.example.macro-def/my-macro")))) |
| 52 | + (is (found? #"defmacro my-macro" (find-macro "com.example.macro-def/my-macro" false)))) |
53 | 53 | (reset! @#'refactor-nrepl.find.find-macros/macro-defs-cache {}) |
54 | 54 | (with-redefs [refactor-nrepl.find.find-macros/put-cached-macro-definitions |
55 | 55 | (fn [& _] (throw (Exception. "Expected!")))] |
56 | 56 | (is (thrown-with-msg? Exception #"Expected!" |
57 | | - (find-macro "com.example.macro-def/my-macro"))))) |
| 57 | + (find-macro "com.example.macro-def/my-macro" false))))) |
0 commit comments