emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode 93e1040ea9 01/10: feat(tests): use font-lo


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode 93e1040ea9 01/10: feat(tests): use font-lock-ensure instead of font-lock-fontify-buffer
Date: Sat, 30 Jul 2022 06:59:04 -0400 (EDT)

branch: elpa/typescript-mode
commit 93e1040ea92ecc790d52e47726b2eecf5b64137a
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>

    feat(tests): use font-lock-ensure instead of font-lock-fontify-buffer
    
    The function font-lock-fontify-buffer is only for interactive use.
---
 typescript-mode-test-utilities.el | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/typescript-mode-test-utilities.el 
b/typescript-mode-test-utilities.el
index faa6c1166a..8a1d21e1ae 100644
--- a/typescript-mode-test-utilities.el
+++ b/typescript-mode-test-utilities.el
@@ -26,8 +26,8 @@
   (declare (debug t)
            (indent 1))
   `(test-with-temp-buffer
-    ,content
-     (font-lock-fontify-buffer)
+       ,content
+     (font-lock-ensure (point-min) (point-max))
      ,@body))
 
 (defun get-face-at (loc)
@@ -48,15 +48,15 @@ It should be a list of (LOCATION . FACE) pairs, where
 LOCATION can be either a single location, or list of locations,
 that are all expected to have the same face."
   (test-with-fontified-buffer
-   contents
-   ;; Make sure our propertize function has been applied to the whole
-   ;; buffer.
-   (syntax-propertize (point-max))
-   (dolist (spec expected)
-     (if (listp (car spec))
-         (dolist (source (car spec))
-           (should (eq (get-face-at source) (cdr spec))))
-       (should (eq (get-face-at (car spec)) (cdr spec)))))))
+      contents
+    ;; Make sure our propertize function has been applied to the whole
+    ;; buffer.
+    (syntax-propertize (point-max))
+    (dolist (spec expected)
+      (if (listp (car spec))
+          (dolist (source (car spec))
+            (should (eq (get-face-at source) (cdr spec))))
+        (should (eq (get-face-at (car spec)) (cdr spec)))))))
 
 (provide 'typescript-mode-test-utilities)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]