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

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

[elpa] externals/csharp-mode 9743156 158/459: Test-case for fontificatio


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 9743156 158/459: Test-case for fontification error
Date: Sun, 22 Aug 2021 13:59:17 -0400 (EDT)

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

    Test-case for fontification error
    
    Documented here: https://github.com/josteink/csharp-mode/issues/69
---
 csharp-mode-tests.el                               | 23 +++++++++++++++++++++-
 ...ation-test-compiler-directives-with-comments.cs |  5 +++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 926685a..1a8ac1a 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -85,6 +85,27 @@
                (equal-including-properties reference t1)
                (equal-including-properties reference t2))))))
 
+(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)))))
+
 (defun list-repeat-once (mylist)
   (append mylist mylist))
 
@@ -194,7 +215,7 @@
     (should (string-match-p "TwoGeneric<T1,T2>" imenu-items))))
 
 (def-imenutest imenu-parsing-supports-comments
-  "./test-files/imenu-comment-test.cs" imenu-index 
+  "./test-files/imenu-comment-test.cs" imenu-index
   (let* ((class-entry    (cadr imenu-index))
          (class-entries  (cdr class-entry))
          (imenu-items    (mapconcat 'car class-entries " ")))
diff --git a/test-files/fontification-test-compiler-directives-with-comments.cs 
b/test-files/fontification-test-compiler-directives-with-comments.cs
new file mode 100644
index 0000000..ca390a8
--- /dev/null
+++ b/test-files/fontification-test-compiler-directives-with-comments.cs
@@ -0,0 +1,5 @@
+#region case 1
+
+// this is a comment
+#region case 2
+



reply via email to

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