Skip to content

Commit a3cb333

Browse files
committed
Add doc-string tests
1 parent e6d5224 commit a3cb333

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/clojure-mode-syntax-test.el

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@
7777
(backward-prefix-chars)
7878
(should (bobp)))))
7979

80+
(ert-deftest test-clojure-in-docstring-p ()
81+
(with-temp-buffer
82+
(insert "(def my-example-variable
83+
\"Doc here and `doc-here`\"
84+
nil)")
85+
(clojure-mode)
86+
(font-lock-ensure)
87+
(goto-char 32)
88+
(should (clojure-in-docstring-p))
89+
(goto-char 46)
90+
(should (clojure-in-docstring-p))))
91+
8092
(def-refactor-test test-paragraph-fill-within-comments
8193
"
8294
;; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
@@ -105,4 +117,19 @@
105117
(let ((fill-column 80))
106118
(fill-paragraph)))
107119

120+
(def-refactor-test test-paragraph-fill-not-altering-surrounding-code
121+
"(def my-example-variable
122+
\"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.\"
123+
nil)"
124+
"(def my-example-variable
125+
\"It has a very long docstring. So long, in fact, that it wraps onto multiple
126+
lines! This is to demonstrate what happens when the docstring wraps over three
127+
lines.\"
128+
nil)"
129+
(switch-to-buffer (current-buffer))
130+
(font-lock-ensure)
131+
(goto-char 40) ; land in doc-string
132+
(let ((fill-column 80))
133+
(fill-paragraph)))
134+
108135
(provide 'clojure-mode-syntax-test)

0 commit comments

Comments
 (0)