Skip to content

Commit 45bdd88

Browse files
committed
Add tests for the escape char font-locking
1 parent fac7dbf commit 45bdd88

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

clojure-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,8 +1338,8 @@ nil."
13381338
(let ((beg (match-beginning 2)))
13391339
(when beg
13401340
(if regex
1341-
(and (char-before beg) (char-equal ?# (char-before beg)) (1- beg))
1342-
(when (not (char-equal ?# (char-before beg)))
1341+
(and (char-before beg) (eq ?# (char-before beg)) (1- beg))
1342+
(when (not (eq ?# (char-before beg)))
13431343
beg))))))))
13441344

13451345
(defun clojure-char-at-point ()

test/clojure-mode-font-lock-test.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ POS."
113113
(should (equal (clojure-test-face-at 3 10 ";`#'s/trim`") '(font-lock-constant-face font-lock-comment-face)))
114114
(should (equal (clojure-test-face-at 11 11 ";`#'s/trim`") font-lock-comment-face)))
115115

116+
(ert-deftest clojure-mode-syntax-table/stuff-in-backticks ()
117+
:tags '(fontification syntax-table)
118+
(should (equal (clojure-test-face-at 1 2 "\"a\\bc\\n\"") font-lock-string-face))
119+
(should (equal (clojure-test-face-at 3 4 "\"a\\bc\\n\"") '(bold font-lock-string-face)))
120+
(should (equal (clojure-test-face-at 5 5 "\"a\\bc\\n\"") font-lock-string-face))
121+
(should (equal (clojure-test-face-at 6 7 "\"a\\bc\\n\"") '(bold font-lock-string-face)))
122+
(should (equal (clojure-test-face-at 4 5 "#\"a\\bc\\n\"") '(bold font-lock-string-face))))
123+
116124
(ert-deftest clojure-mode-syntax-table/fontify-namespaced-keyword ()
117125
:tags '(fontification syntax-table)
118126
(should (equal (clojure-test-face-at 9 11 "(:alias/def x 10)") '(clojure-keyword-face)))

0 commit comments

Comments
 (0)