Skip to content

Commit f92e7a9

Browse files
vspinubbatsov
authored andcommitted
Add doc-string tests
1 parent 0dfbdcc commit f92e7a9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Diff for: clojure-mode-syntax-test.el

+29
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
(insert (car form))
6969
(equal (symbol-name (symbol-at-point)) (cdr form)))))
7070

71+
7172
(ert-deftest clojure-syntax-skip-prefixes ()
7273
(dolist (form '("#?@aaa" "#?aaa" "#aaa" "'aaa"))
7374
(with-temp-buffer
@@ -105,4 +106,32 @@
105106
(let ((fill-column 80))
106107
(fill-paragraph)))
107108

109+
(when (fboundp 'font-lock-ensure)
110+
(def-refactor-test test-paragraph-fill-not-altering-surrounding-code
111+
"(def my-example-variable
112+
\"It has a very long docstring. So long, in fact, that it wraps onto multiple lines! This is to demonstrate what happens when the docstring wraps over three lines.\"
113+
nil)"
114+
"(def my-example-variable
115+
\"It has a very long docstring. So long, in fact, that it wraps onto multiple
116+
lines! This is to demonstrate what happens when the docstring wraps over three
117+
lines.\"
118+
nil)"
119+
(font-lock-ensure)
120+
(goto-char 40)
121+
(let ((clojure-docstring-fill-column 80)
122+
(fill-column 80))
123+
(fill-paragraph)))
124+
125+
(ert-deftest test-clojure-in-docstring-p ()
126+
(with-temp-buffer
127+
(insert "(def my-example-variable
128+
\"Doc here and `doc-here`\"
129+
nil)")
130+
(clojure-mode)
131+
(font-lock-ensure)
132+
(goto-char 32)
133+
(should (clojure-in-docstring-p))
134+
(goto-char 46)
135+
(should (clojure-in-docstring-p)))))
136+
108137
(provide 'clojure-mode-syntax-test)

0 commit comments

Comments
 (0)