Skip to content

Commit fbf55ac

Browse files
committed
Merge pull request #505 from carlosgeos/fix-445
[Fix #445] def form with strings and docstrings
2 parents 7793a4d + 49b6a48 commit fbf55ac

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

clojure-mode-font-lock-test.el

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,34 @@ POS."
731731
(should (eq (clojure-test-face-at 6 8 "(def foo 10)")
732732
'font-lock-variable-name-face)))
733733

734+
(ert-deftest clojure-mode-syntax-table/variable-def-string ()
735+
:tags '(fontification syntax-table)
736+
(should (eq (clojure-test-face-at 10 16 "(def foo \"hello\")")
737+
'font-lock-string-face))
738+
(should (eq (clojure-test-face-at 10 16 "(def foo \"hello\" )")
739+
'font-lock-string-face))
740+
(should (eq (clojure-test-face-at 13 19 "(def foo \n \"hello\")")
741+
'font-lock-string-face))
742+
(should (eq (clojure-test-face-at 13 19 "(def foo \n \"hello\"\n)")
743+
'font-lock-string-face)))
744+
745+
(ert-deftest clojure-mode-syntax-table/variable-def-string-with-docstring ()
746+
:tags '(fontification syntax-table)
747+
(should (eq (clojure-test-face-at 10 16 "(def foo \"usage\" \"hello\")")
748+
'font-lock-doc-face))
749+
(should (eq (clojure-test-face-at 18 24 "(def foo \"usage\" \"hello\")")
750+
'font-lock-string-face))
751+
(should (eq (clojure-test-face-at 18 24 "(def foo \"usage\" \"hello\" )")
752+
'font-lock-string-face))
753+
(should (eq (clojure-test-face-at 21 27 "(def foo \"usage\" \n \"hello\")")
754+
'font-lock-string-face))
755+
(should (eq (clojure-test-face-at 13 19 "(def foo \n \"usage\" \"hello\")")
756+
'font-lock-doc-face))
757+
(should (eq (clojure-test-face-at 13 19 "(def foo \n \"usage\" \n \"hello\")")
758+
'font-lock-doc-face))
759+
(should (eq (clojure-test-face-at 24 30 "(def foo \n \"usage\" \n \"hello\")")
760+
'font-lock-string-face)))
761+
734762
(ert-deftest clojure-mode-syntax-table/type-def ()
735763
:tags '(fontification syntax-table)
736764
(clojure-test-with-temp-buffer "(deftype Foo)"

clojure-mode-indentation-test.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ values of customisable variables."
6868
(search-forward "|")
6969
(delete-char -1)
7070
(clojure-mode)
71+
(font-lock-ensure)
7172
(indent-according-to-mode)
7273

7374
(should (equal expected-state (buffer-string)))
@@ -118,6 +119,10 @@ values of customisable variables."
118119
(->>
119120
|expr)")
120121

122+
(check-indentation no-indent-for-def-string
123+
"(def foo \"hello|\")"
124+
"(def foo \"hello|\")")
125+
121126
(check-indentation doc-strings-without-indent-specified
122127
"
123128
(defn some-fn

0 commit comments

Comments
 (0)