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

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

[elpa] externals/csharp-mode b1e237d 172/459: Add tests


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode b1e237d 172/459: Add tests
Date: Sun, 22 Aug 2021 13:59:20 -0400 (EDT)

branch: externals/csharp-mode
commit b1e237d687680d13a18ce5829948a3483819a8ce
Author: Vasilij Schneidermann <v.schneidermann@gmail.com>
Commit: Vasilij Schneidermann <v.schneidermann@gmail.com>

    Add tests
---
 csharp-mode-tests.el             | 15 +++++++++++++++
 test-files/fontification-test.cs |  2 ++
 2 files changed, 17 insertions(+)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index d088c43..2aa9281 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -67,6 +67,21 @@
            "Type2" 'font-lock-type-face
            )))
 
+(ert-deftest fontification-of-literals-allows-multi-line-strings ()
+  (require 'assess)
+  (should (assess-face-at=
+           "string Literal = \"multi-line\nstring\";"
+           'csharp-mode
+           ;; should be interpreted as error
+           18 'font-lock-warning-face
+           ))
+  (should (assess-face-at=
+           "string Literal = @\"multi-line\nstring\";"
+           'csharp-mode
+           ;; should not be interpreted as error because of @
+           19 'font-lock-string-face
+           )))
+
 (ert-deftest fontification-of-compiler-directives ()
   ;; this replaces the manual test of
   ;; test-files/fontification-test-compiler-directives.cs, but file
diff --git a/test-files/fontification-test.cs b/test-files/fontification-test.cs
index c743ede..51a008a 100644
--- a/test-files/fontification-test.cs
+++ b/test-files/fontification-test.cs
@@ -2,3 +2,5 @@ public const string Literal1 = @"literal without trailing 
slash";
 public const bool Reference = true;
 public const string Literal2 = @"literal with trailing slash\"; 
 public const bool Reference = true;
+public const string Literal3 = @"multi-line
+literal";



reply via email to

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