[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 628a4e2 248/459: Added testcases for region
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 628a4e2 248/459: Added testcases for region fontification. |
Date: |
Sun, 22 Aug 2021 13:59:37 -0400 (EDT) |
branch: externals/csharp-mode
commit 628a4e2afa0e9c4672e8654c86240cb7f7bdf444
Author: Tim Van Holder <tim.vanholder@leeloo.anubex.internal>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Added testcases for region fontification.
Extended test-files/region-fontification.cs with more cases.
Added a test to ensure all cases get fontified correctly.
---
csharp-mode-tests.el | 11 +++++++++++
test-files/region-fontification.cs | 35 ++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 5fb917c..fb72759 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -386,6 +386,17 @@
(forward-word -1)
(should (looking-at "fontifies")))
+(ert-deftest fontification-of-regions ()
+ (require 'assess)
+ (require 'm-buffer)
+ (find-file "test-files/region-fontification.cs")
+ (csharp-mode)
+ (let ((buf (current-buffer)))
+ ;; look for 'a region comment' - should always be a comment
+ (should (assess-face-at= buf 'csharp-mode (lambda (buf) (m-buffer-match
buf "a region comment")) 'font-lock-comment-face))
+ ;; look for 'string' - should always be a type
+ (should (assess-face-at= buf 'csharp-mode (lambda (buf) (m-buffer-match
buf "string")) 'font-lock-type-face))))
+
;;(ert-run-tests-interactively t)
;; (local-set-key (kbd "<f6>") '(lambda ()
;; (interactive)
diff --git a/test-files/region-fontification.cs
b/test-files/region-fontification.cs
index 8012948..0b4fbfb 100644
--- a/test-files/region-fontification.cs
+++ b/test-files/region-fontification.cs
@@ -4,12 +4,41 @@ public class Test
{
public void Test()
{
- #region fontifies correctly
+ #region fontifies as a region comment
string foo = "bar";
#endregion
- #region does'nt fontify correctly
+ #region quotes shouldn't mess up a region comment
+ string foo = "bar";
+ #endregion
+
+ #region any number of spaces are allowed before a region comment
+ string foo = "bar";
+ #endregion
+
+ #region a TAB is also allowed before a region comment
+ string foo = "bar";
+ #endregion
+
+ # region a region comment is fine when there are spaces between the #
and the region
+ string foo = "bar";
+ # endregion
+
+ # region a TAB between the # and the region doesn't stop this
being a region comment either
+ string foo = "bar";
+ # endregion
+
+ #region --- a region comment doesn't have to start with a word ---
+ string foo = "bar";
+ #endregion
+
+ #region "a region comment can even look like this"
+ string foo = "bar";
+ #endregion
+
+ // This is here just to ensure the commentification doesn't bleed to
the next line
+ #region
string foo = "bar";
#endregion
}
-}
\ No newline at end of file
+}
- [elpa] externals/csharp-mode 14bc3c6 215/459: Fix broken syntax-propertize., (continued)
- [elpa] externals/csharp-mode 14bc3c6 215/459: Fix broken syntax-propertize., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 2275dda 218/459: Properly document workaround for syntax-properties, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0183fc4 221/459: Prepare changelog for future bugs :), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0cd0b2c 226/459: Fix fontification of using-statements., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0d35431 228/459: Fix fontification of namespaces to match using-statement rules., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3c989a8 230/459: using: Don't mess up alnums in indentifier-fontification., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5787aef 233/459: Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 14e0327 235/459: Bump version and updated-date., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5ca1702 236/459: Make csharp-mode-map inherit from prog-mode-map, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0f65654 245/459: Add regression test, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 628a4e2 248/459: Added testcases for region fontification.,
ELPA Syncer <=
- [elpa] externals/csharp-mode 79e0a60 256/459: New simpler build based on Cask, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bf613f8 274/459: Handle failure correctly, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5d0ffaa 113/459: Use cl-lib equivalents for incf and decf, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6af6f88 111/459: Fix fontification tests., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7247a27 115/459: Prefix set-difference from cl.el, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 71b0e96 116/459: Fix errors and warnings in unit-tests., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 56a9a87 117/459: Fix backwards compatibility and broken CI-build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c446400 118/459: Remove obsolete comment, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 829ad4d 120/459: Another stab at fixing the CI., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ae1e36c 132/459: Tentative fix for imenu and generics, ELPA Syncer, 2021/08/22