|
61 | 61 | (expect (non-func "#macro " form) :to-be nil))))
|
62 | 62 |
|
63 | 63 | (describe "clojure-match-next-def"
|
64 |
| - (it "handles vars with metadata" |
65 |
| - (with-clojure-buffer " |
66 |
| -(def ^Integer a 1) |
67 |
| -(list [1 2 3])" |
68 |
| - (end-of-buffer) |
69 |
| - (clojure-match-next-def) |
70 |
| - (expect (looking-at "(def")))) |
71 |
| - (it "handles vars with metadata only" |
72 |
| - (with-clojure-buffer " |
73 |
| -(def ^Integer) |
74 |
| -(list [1 2 3])" |
75 |
| - (end-of-buffer) |
76 |
| - (clojure-match-next-def) |
77 |
| - (expect (looking-at "(def")))) |
78 |
| - (it "handles vars without metadata" |
79 |
| - (with-clojure-buffer " |
80 |
| -(def a 1) |
81 |
| -(list [1 2 3])" |
82 |
| - (end-of-buffer) |
83 |
| - (clojure-match-next-def) |
84 |
| - (expect (looking-at "(def")))) |
85 |
| - (it "handles empty def forms" |
86 |
| - (with-clojure-buffer " |
87 |
| -(def) |
88 |
| -(list [1 2 3])" |
89 |
| - (end-of-buffer) |
90 |
| - (clojure-match-next-def) |
91 |
| - (expect (looking-at "(def"))))) |
| 64 | + (let ((some-sexp "\n(list [1 2 3])")) |
| 65 | + (it "handles vars with metadata" |
| 66 | + (dolist (form '("(def ^Integer a 1)" |
| 67 | + "(def ^:a a 1)" |
| 68 | + "(def ^::a a 1)" |
| 69 | + "(def ^::a/b a 1)" |
| 70 | + "(def ^{:macro true} a 1)")) |
| 71 | + (with-clojure-buffer (concat form some-sexp) |
| 72 | + (end-of-buffer) |
| 73 | + (clojure-match-next-def) |
| 74 | + (expect (looking-at "(def"))))) |
| 75 | + |
| 76 | + (it "handles vars without metadata" |
| 77 | + (with-clojure-buffer (concat "(def a 1)" some-sexp) |
| 78 | + (end-of-buffer) |
| 79 | + (clojure-match-next-def) |
| 80 | + (expect (looking-at "(def")))) |
| 81 | + |
| 82 | + (it "handles invalid def forms" |
| 83 | + (dolist (form '("(def ^Integer)" |
| 84 | + "(def)" |
| 85 | + "(def ^{:macro})" |
| 86 | + "(def ^{:macro true})" |
| 87 | + "(def ^{:macro true} foo)" |
| 88 | + "(def ^{:macro} foo)")) |
| 89 | + (with-clojure-buffer (concat form some-sexp) |
| 90 | + (end-of-buffer) |
| 91 | + (clojure-match-next-def) |
| 92 | + (expect (looking-at "(def"))))))) |
92 | 93 |
|
93 | 94 | (describe "clojure syntax"
|
94 | 95 | (it "handles prefixed symbols"
|
|
0 commit comments