aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTom Tromey2017-02-25 10:27:48 -0700
committerTom Tromey2017-02-25 14:02:37 -0700
commit8db75f0ef9ad821bab0a2613bb8e549edbf14eb6 (patch)
tree4a40206bb0fdbc574953d8936342426c443d422f /test
parent546d30ed1400d5a434886790a102bd37ec852919 (diff)
downloademacs-8db75f0ef9ad821bab0a2613bb8e549edbf14eb6.tar.gz
emacs-8db75f0ef9ad821bab0a2613bb8e549edbf14eb6.zip
Use font-lock-doc-face in js-mode
Bug#25858: * lisp/progmodes/js.el (js-font-lock-syntactic-face-function): New defun. (js-mode): Use it. * test/lisp/progmodes/js-tests.el (js-mode-doc-comment-face): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/js-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index 07e659af605..e030675e07c 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -128,6 +128,18 @@ if (!/[ (:,='\"]/.test(value)) {
128 ;; Any success is ok here. 128 ;; Any success is ok here.
129 (should t))) 129 (should t)))
130 130
131(ert-deftest js-mode-doc-comment-face ()
132 (dolist (test '(("/*" "*/" font-lock-comment-face)
133 ("//" "\n" font-lock-comment-face)
134 ("/**" "*/" font-lock-doc-face)
135 ("\"" "\"" font-lock-string-face)))
136 (with-temp-buffer
137 (js-mode)
138 (insert (car test) " he")
139 (save-excursion (insert "llo " (cadr test)))
140 (font-lock-ensure)
141 (should (eq (get-text-property (point) 'face) (caddr test))))))
142
131(provide 'js-tests) 143(provide 'js-tests)
132 144
133;;; js-tests.el ends here 145;;; js-tests.el ends here