Skip to content

Commit 93e1040

Browse files
committed
feat(tests): use font-lock-ensure instead of font-lock-fontify-buffer
The function font-lock-fontify-buffer is only for interactive use.
1 parent 83bf47e commit 93e1040

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

typescript-mode-test-utilities.el

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
(declare (debug t)
2727
(indent 1))
2828
`(test-with-temp-buffer
29-
,content
30-
(font-lock-fontify-buffer)
29+
,content
30+
(font-lock-ensure (point-min) (point-max))
3131
,@body))
3232

3333
(defun get-face-at (loc)
@@ -48,15 +48,15 @@ It should be a list of (LOCATION . FACE) pairs, where
4848
LOCATION can be either a single location, or list of locations,
4949
that are all expected to have the same face."
5050
(test-with-fontified-buffer
51-
contents
52-
;; Make sure our propertize function has been applied to the whole
53-
;; buffer.
54-
(syntax-propertize (point-max))
55-
(dolist (spec expected)
56-
(if (listp (car spec))
57-
(dolist (source (car spec))
58-
(should (eq (get-face-at source) (cdr spec))))
59-
(should (eq (get-face-at (car spec)) (cdr spec)))))))
51+
contents
52+
;; Make sure our propertize function has been applied to the whole
53+
;; buffer.
54+
(syntax-propertize (point-max))
55+
(dolist (spec expected)
56+
(if (listp (car spec))
57+
(dolist (source (car spec))
58+
(should (eq (get-face-at source) (cdr spec))))
59+
(should (eq (get-face-at (car spec)) (cdr spec)))))))
6060

6161
(provide 'typescript-mode-test-utilities)
6262

0 commit comments

Comments
 (0)