@@ -146,23 +146,38 @@ and point left there."
146
146
; ; we should not cache the results of `clojure-find-ns' here
147
147
(let ((clojure-cache-ns nil ))
148
148
(with-temp-buffer
149
- (insert " (ns ^{:doc \" Some docs\" }\n foo-bar)" )
150
- (newline )
151
- (newline )
152
- (insert " (in-ns 'baz-quux)" )
153
- (clojure-mode)
154
-
155
- ; ; From inside docstring of first ns
156
- (goto-char 18 )
157
- (should (equal " foo-bar" (clojure-find-ns)))
158
-
159
- ; ; From inside first ns's name, on its own line
160
- (goto-char 29 )
161
- (should (equal " foo-bar" (clojure-find-ns)))
162
-
163
- ; ; From inside second ns's name
164
- (goto-char 42 )
165
- (should (equal " baz-quux" (clojure-find-ns))))))
149
+ (insert " (ns ^{:doc \" Some docs\" }\n foo-bar)" )
150
+ (newline )
151
+ (newline )
152
+ (insert " (in-ns 'baz-quux)" )
153
+ (clojure-mode)
154
+
155
+ ; ; From inside docstring of first ns
156
+ (goto-char 18 )
157
+ (should (equal " foo-bar" (clojure-find-ns)))
158
+
159
+ ; ; From inside first ns's name, on its own line
160
+ (goto-char 29 )
161
+ (should (equal " foo-bar" (clojure-find-ns)))
162
+
163
+ ; ; From inside second ns's name
164
+ (goto-char 42 )
165
+ (should (equal " baz-quux" (clojure-find-ns))))
166
+ (let ((data
167
+ '((" \"\n (ns foo-bar)\"\n " " (in-ns 'baz-quux)" " baz-quux" )
168
+ (" ;(ns foo-bar)\n " " (in-ns 'baz-quux)" " baz-quux" )
169
+ (" (ns foo-bar)\n " " \"\n (in-ns 'baz-quux)\" " " foo-bar" )
170
+ (" (ns foo-bar)\n " " ;(in-ns 'baz-quux)" " foo-bar" ))))
171
+ (pcase-dolist (`(, form1 , form2 , expected ) data)
172
+ (with-temp-buffer
173
+ (insert form1)
174
+ (save-excursion (insert form2))
175
+ (clojure-mode)
176
+ ; ; Between the two namespaces
177
+ (should (equal expected (clojure-find-ns)))
178
+ ; ; After both namespaces
179
+ (goto-char (point-max ))
180
+ (should (equal expected (clojure-find-ns))))))))
166
181
167
182
(provide 'clojure-mode-sexp-test )
168
183
0 commit comments