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

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

[elpa] externals/csharp-mode acaa9bb 169/459: Make another fontification


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode acaa9bb 169/459: Make another fontification-test assess-based.
Date: Sun, 22 Aug 2021 13:59:20 -0400 (EDT)

branch: externals/csharp-mode
commit acaa9bb11e059e7035008e746db823efc46a4974
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Make another fontification-test assess-based.
    
    This concludes the conversion of all fontification tests.
---
 csharp-mode-tests.el | 34 +++++++++++++++-------------------
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index fc7efb7..d088c43 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -92,25 +92,21 @@
            )))
 
 (ert-deftest fontification-of-compiler-directives-after-comments ()
-  (let* ((buffer (find-file-read-only 
"test-files/fontification-test-compiler-directives-with-comments.cs")))
-    ;; double-ensure mode is active
-    (csharp-mode)
-    (if (fboundp 'font-lock-ensure)
-        (font-lock-ensure))
-    (goto-char (point-min))
-
-    (let (reference
-          testee)
-
-      (search-forward "case 1")
-      (move-beginning-of-line 1)
-      (setq reference (face-at-point))
-
-      (search-forward "case 2")
-      (move-beginning-of-line 1)
-      (setq testee (face-at-point))
-
-      (should (equal reference testee)))))
+  ;; this replaces the manual test of
+  ;; test-files/fontification-test-compiler-directives-with-comments.cs, but 
file
+  ;; has been kept around to assist manual testing/verification.
+  (require 'assess)
+  (let* ((test-string "#region case 1\n\n//this is a comment\n#region case2"))
+    (should (assess-face-at=
+             test-string
+             'csharp-mode
+             ;; should not be interpreted as string because of trailing \!
+             "case1" 'font-lock-comment-face))
+    (should (assess-face-at=
+             test-string
+             'csharp-mode
+             ;; should not be interpreted as string because of trailing \!
+             "case2" 'font-lock-comment-face))))
 
 (defun list-repeat-once (mylist)
   (append mylist mylist))



reply via email to

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