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

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

[elpa] externals/csharp-mode f1a2e06 110/459: Add unit-test for fontific


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode f1a2e06 110/459: Add unit-test for fontification of compiler-directives.
Date: Sun, 22 Aug 2021 13:59:07 -0400 (EDT)

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

    Add unit-test for fontification of compiler-directives.
---
 csharp-mode-tests.el                               | 23 ++++++++++++++++++++++
 .../fontification-test-compiler-directives.cs      | 23 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 3db42f1..3c13be8 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -49,6 +49,29 @@
       (should
        (equal buffer1 buffer2)))))
 
+(ert-deftest fontification-of-compiler-directives ()
+  (let* ((buffer (find-file-read-only 
"test-files/fontification-test-compiler-directives.cs")))
+    ;; double-ensure mode is active
+    (csharp-mode)
+    (goto-char (point-min))
+    (let* ((buffer1)
+           (buffer2))
+      ;; get reference string
+      (move-to-line-after "reference")
+      (setq reference (get-current-line-contents))
+
+      ;; get verification string
+      (move-to-line-after "t1")
+      (setq t1 (get-current-line-contents))
+
+      ;; get verification string
+      (move-to-line-after "t2")
+      (setq t2 (get-current-line-contents))
+
+      ;; check equality
+      (should (equal reference t1))
+      (should (equal reference t2)))))
+
 (defun list-repeat-once (mylist)
   (append mylist mylist))
 
diff --git a/test-files/fontification-test-compiler-directives.cs 
b/test-files/fontification-test-compiler-directives.cs
new file mode 100644
index 0000000..f87b45b
--- /dev/null
+++ b/test-files/fontification-test-compiler-directives.cs
@@ -0,0 +1,23 @@
+using System;
+
+public class Test
+{
+    public void Test()
+    {
+        string x;
+
+        // reference
+        x += "foo";
+        #region t1 test
+        x += "foo";
+        #endregion
+
+        #region t2 test'
+        x += "foo";
+        #endregion
+
+        #region t2 - test"
+        x += "foo";
+        #endregion
+    }
+}



reply via email to

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