From 198c777c2ba58e94a6b035c286c660669a7ce2a9 Mon Sep 17 00:00:00 2001 From: Miodrag Milenkovic Date: Fri, 1 Mar 2019 12:34:29 -0500 Subject: Replaced font-lock-fontify-buffer with font-lock-ensure --- rust-mode-tests.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index a5fea28..42d2dad 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1234,7 +1234,7 @@ fn test4();") (with-temp-buffer (rust-mode) (insert str) - (font-lock-fontify-buffer) + (font-lock-ensure) (buffer-string))) (defun rust-test-group-str-by-face (str) @@ -1503,7 +1503,7 @@ this_is_not_a_string();)" 1......................500......................50 \"#; ") - (font-lock-fontify-buffer) + (font-lock-ensure) (goto-char 530) (insert "#") ;; We have now closed the raw string. Check that the whole string is @@ -1880,7 +1880,7 @@ fn indented_already() { \n // The previous line already has its spaces } ") - (font-lock-fontify-buffer) + (font-lock-ensure) (goto-line 11) (move-to-column 0) (indent-for-tab-command) @@ -2115,7 +2115,7 @@ fn main() { (with-temp-buffer (rust-mode) (insert content) - (font-lock-fontify-buffer) + (font-lock-ensure) (dolist (pair pairs) (let* ((open-pos (nth 0 pair)) (close-pos (nth 1 pair))) @@ -2148,7 +2148,7 @@ fn main() { (ert-deftest rust-test-two-character-quotes-in-a-row () (with-temp-buffer (rust-mode) - (font-lock-fontify-buffer) + (font-lock-ensure) (insert "'\\n','a', fn") (font-lock-after-change-function 1 12 0) @@ -3108,7 +3108,7 @@ impl Two<'a> { (with-temp-buffer (rust-mode) (insert original) - (font-lock-fontify-buffer) + (font-lock-ensure) (goto-char point-pos) (deactivate-mark) -- cgit v1.3 From c1059d6e8bdc6413cc7a05edd1b44205acc3bc15 Mon Sep 17 00:00:00 2001 From: Miodrag Milenkovic Date: Fri, 1 Mar 2019 12:46:35 -0500 Subject: Added angle bracket tests, some of which fail without the fix --- rust-mode-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 42d2dad..70603e3 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -2414,6 +2414,14 @@ fn main() { "/* " font-lock-comment-delimiter-face "no-op */" font-lock-comment-face))) +(ert-deftest font-lock-fontify-angle-brackets () + "Test that angle bracket fontify" + (should (equal (rust-test-fontify-string "<>") "<>")) + (should (equal (rust-test-fontify-string "") "")) + (should (equal (rust-test-fontify-string "<<>>") "<<>>")) + (should (equal (rust-test-fontify-string "<>>") "<>>")) + (should (equal (rust-test-fontify-string "<<>") "<<>"))) + (ert-deftest rust-test-basic-paren-matching () (rust-test-matching-parens " -- cgit v1.3 From 497d47679ad0349b43b744c9ef4ac16a610c0779 Mon Sep 17 00:00:00 2001 From: Miodrag Milenkovic Date: Fri, 1 Mar 2019 12:55:35 -0500 Subject: Reverted back to font-lock-fontify-buffer because emacs 24 doesn't know about font-lock-ensure --- rust-mode-tests.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rust-mode-tests.el') diff --git a/rust-mode-tests.el b/rust-mode-tests.el index 70603e3..72a9e4e 100644 --- a/rust-mode-tests.el +++ b/rust-mode-tests.el @@ -1234,7 +1234,7 @@ fn test4();") (with-temp-buffer (rust-mode) (insert str) - (font-lock-ensure) + (font-lock-fontify-buffer) (buffer-string))) (defun rust-test-group-str-by-face (str) @@ -1503,7 +1503,7 @@ this_is_not_a_string();)" 1......................500......................50 \"#; ") - (font-lock-ensure) + (font-lock-fontify-buffer) (goto-char 530) (insert "#") ;; We have now closed the raw string. Check that the whole string is @@ -1880,7 +1880,7 @@ fn indented_already() { \n // The previous line already has its spaces } ") - (font-lock-ensure) + (font-lock-fontify-buffer) (goto-line 11) (move-to-column 0) (indent-for-tab-command) @@ -2115,7 +2115,7 @@ fn main() { (with-temp-buffer (rust-mode) (insert content) - (font-lock-ensure) + (font-lock-fontify-buffer) (dolist (pair pairs) (let* ((open-pos (nth 0 pair)) (close-pos (nth 1 pair))) @@ -2148,7 +2148,7 @@ fn main() { (ert-deftest rust-test-two-character-quotes-in-a-row () (with-temp-buffer (rust-mode) - (font-lock-ensure) + (font-lock-fontify-buffer) (insert "'\\n','a', fn") (font-lock-after-change-function 1 12 0) @@ -3116,7 +3116,7 @@ impl Two<'a> { (with-temp-buffer (rust-mode) (insert original) - (font-lock-ensure) + (font-lock-fontify-buffer) (goto-char point-pos) (deactivate-mark) -- cgit v1.3