[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode adb7928 175/459: New test-macros for assess
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode adb7928 175/459: New test-macros for assess. |
Date: |
Sun, 22 Aug 2021 13:59:21 -0400 (EDT) |
branch: externals/csharp-mode
commit adb79282db31844ea4bc0e0cb05df9f75c694aa8
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
New test-macros for assess.
---
csharp-mode-tests.el | 43 +++++++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 094b364..b2c0828 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -17,6 +17,20 @@
;;; test-helper functions
+(defmacro assess-face-in-text= (testee &rest assessments)
+ (when assessments
+ (let* ((text (car assessments))
+ (face (cadr assessments))
+ (rest (cddr assessments)))
+ `(progn
+ (should (assess-face-at= ,testee 'csharp-mode ,text ,face))
+ (assess-face-in-text= ,testee ,@rest)))))
+
+(defmacro assess-face-in-file= (file-name &rest assessments)
+ (let* ((buffer (find-file-read-only file-name))
+ (contents (buffer-substring-no-properties (point-min) (point-max))))
+ (kill-buffer buffer)
+ `(assess-face-in-text= ,contents ,@assessments)))
;;; actual tests
@@ -29,25 +43,26 @@
(defvar debug-res nil)
(ert-deftest fontification-of-literals-detects-end-of-strings ()
- ;; this replaces the manual test of fontification-test.cs, but file has been
- ;; kept around to assist manual testing/verification.
- (should (assess-face-at=
- "string Literal = @\"with trailing slash\\\";\n public Type2
Reference = null;"
- 'csharp-mode
- ;; should not be interpreted as string because of trailing \!
- "Type2" 'font-lock-type-face
- )))
+ (assess-face-in-file= "./test-files/fontification-test.cs"
+ "bool1" 'font-lock-type-face
+ "Reference1" 'font-lock-variable-name-face
+ "false" 'font-lock-constant-face
+ "bool2" 'font-lock-type-face
+ "Reference2" 'font-lock-variable-name-face
+ "true" 'font-lock-constant-face
+ ))
(ert-deftest fontification-of-compiler-directives ()
;; this replaces the manual test of
;; test-files/fontification-test-compiler-directives.cs, but file
;; has been kept around to assist manual testing/verification.
- (should (assess-face-at=
- "#region test\nx = true;"
- 'csharp-mode
- ;; should not be interpreted as string because of trailing \!
- "true" 'font-lock-constant-face
- ))
+ (assess-face-in-text=
+ "#region test\nbool bar = true;"
+ ;; should not be interpreted as string because of trailing \!
+ "bool" 'font-lock-type-face
+ "bar" 'font-lock-variable-name-face
+ "true" 'font-lock-constant-face
+ )
(should (assess-face-at=
"#region test'\nx = true;"
'csharp-mode
- [elpa] externals/csharp-mode b11fcda 147/459: Imenu: Add support for interface-prefixed methods., (continued)
- [elpa] externals/csharp-mode b11fcda 147/459: Imenu: Add support for interface-prefixed methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bc3bd2a 155/459: Fix devenv.com output-parsing, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9743156 158/459: Test-case for fontification error, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 57b2353 161/459: Bump version since we're working on vNext, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 682e394 162/459: Address issue with cc-mode in Emacs git master., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a631944 165/459: Make check-defuns a make-target., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ce2ff93 168/459: Make fontification-test assess-based., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7fa38d2 170/459: Extend syntax propertize function for vliterals, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bd201c2 171/459: Remove now unused code, move log functions to top, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 15d2214 174/459: Clean up loading of dev-packages., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode adb7928 175/459: New test-macros for assess.,
ELPA Syncer <=
- [elpa] externals/csharp-mode e2c9f85 181/459: New imenu-implementation for csharp-mode., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7943738 182/459: Add volatile keyword, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b4b9d61 183/459: Add volatile to imenu, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9a1ddba 185/459: Merge branch 'jtbm37/master', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a8def67 186/459: Add missing test-file. Fix build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b609f42 187/459: New imenu test-file for method-indexing., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b448614 190/459: Fix fontification of methods found in test-file., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4a396e3 189/459: Add tests for imenu method-indexing., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9c42dac 193/459: Move all defcustoms to the top., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 717bf76 194/459: Fix compilation errors and warnings., ELPA Syncer, 2021/08/22