[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode 3050139 060/459: Add fontification-test.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode 3050139 060/459: Add fontification-test. |
Date: |
Sun, 22 Aug 2021 13:58:56 -0400 (EDT) |
branch: externals/csharp-mode
commit 3050139511c51cbb74482ff9e12677efada4bf10
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Add fontification-test.
---
csharp-mode-tests.el | 45 +++++++++++++++++++++++++++++++++++++++++++--
makefile | 4 ++--
test-files/test.cs | 4 ++++
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 4e028b7..5ab0a45 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -1,12 +1,53 @@
-
(require 'ert)
(require 'csharp-mode)
+;;; test-helper functions
+
+(defun move-to-line-after (text)
+ (search-forward text)
+ (move-beginning-of-line 1)
+ (forward-line 1))
+
+(defun get-current-line-contents ()
+ (let* ((start)
+ (end))
+ (move-beginning-of-line 1)
+ (setq start (point))
+ (move-end-of-line 1)
+ (setq end (point))
+ (buffer-substring start end)))
+
+;;; actual tests
+
(ert-deftest activating-mode-doesnt-cause-failure ()
(with-temp-buffer
(csharp-mode)
(should
(equal 'csharp-mode major-mode))))
-;;(ert-run-tests-interactively t)
+(setq debug-res nil)
+(ert-deftest fontification-of-literals-detects-end-of-strings ()
+ ;; this test needs a double which also writes and generates the actual
+ ;; test-content itself by inserting into a new temp buffer.
+ (let* ((buffer (find-file-read-only "d:/Throwaway/test.cs")))
+ ;; double-ensure mode is active
+ (csharp-mode)
+ (goto-char (point-min))
+ (let* ((buffer1)
+ (buffer2))
+ ;; get reference string
+ (move-to-line-after "Literal1")
+ (setq buffer1 (get-current-line-contents))
+
+ ;; get verification string
+ (move-to-line-after "Literal2")
+ (setq buffer2 (get-current-line-contents))
+
+ ;; check equality
+ (setq debug-res (list buffer1 buffer2))
+ (should
+ (equal buffer1 buffer2)))))
+
+
+;;(ert-run-tests-interactively t)
diff --git a/makefile b/makefile
index e26452f..a095924 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
-VERSION=$(shell grep ";; Version " csharp-mode.el | cut -d ":" -f2 | cut -c2-)
+VERSION=$(shell grep -a ";; Version " csharp-mode.el | cut -d ":" -f2 | cut
-c2-)
PACKAGE_SHORTNAME=csharp-mode
PACKAGE_NAME:=$(PACKAGE_SHORTNAME)-$(VERSION)
PACKAGE_DIR:=./.tmp/$(PACKAGE_NAME)
@@ -9,7 +9,7 @@ ELS = csharp-mode.el csharp-mode-tests.el
ELCS = $(ELS:.el=.elc)
package: $(PACKAGE_DIR)
- tar cvf ../$(PACKAGE_NAME).tar --exclude="*#" --exclude="*~"
--exclude="*tests*" --exclude "*-pkg.el.template*" --exclude="makefile"
--exclude="run-travis-ci.sh" -C $(PACKAGE_DIR)/.. $(PACKAGE_NAME)
+ tar cvf ../$(PACKAGE_NAME).tar --exclude="*#" --exclude="*~"
--exclude="*tests*" --exclude="test-files" --exclude "*-pkg.el.template*"
--exclude="makefile" --exclude="run-travis-ci.sh" -C $(PACKAGE_DIR)/..
$(PACKAGE_NAME)
$(PACKAGE_DIR):
mkdir -p $@
diff --git a/test-files/test.cs b/test-files/test.cs
new file mode 100644
index 0000000..c743ede
--- /dev/null
+++ b/test-files/test.cs
@@ -0,0 +1,4 @@
+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;
- [elpa] externals/csharp-mode be13af4 040/459: remove obsolete yasnippet integration closes #10, (continued)
- [elpa] externals/csharp-mode be13af4 040/459: remove obsolete yasnippet integration closes #10, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f4afe09 039/459: remove flymake integration, closes #8, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 16da60e 048/459: Merge branch 'devel' of github.com:josteink/csharp-mode into devel, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1f11abf 052/459: Add some more reserved keywords to the list., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a2115a6 020/459: remove unnecessary defadvice around tooltip-show, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4c270ac 021/459: Merge pull request #5 from jesse-black/master, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0287b32 034/459: Add build-status to readme., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 64861a6 042/459: Merge branch 'master' into devel, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b2d8fba 049/459: Merge branch 'devel', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7438762 050/459: Update instructions in README., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3050139 060/459: Add fontification-test.,
ELPA Syncer <=
- [elpa] externals/csharp-mode 5ce7809 068/459: add compilation regexps for msbuild for #28, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode e4ce203 065/459: Updated readme., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7805fe8 077/459: Fix const-declaration for compilation-error regexps., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8bd0e66 078/459: fix compilation regexps, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8aaf6ff 059/459: Ensure template-file is not included in MELPA-built package., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8e8c804 061/459: Fix test., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7dec1ea 069/459: make compilation regexps work with xbuild, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 1939c4e 073/459: Extract compilation-mode regexps into constants., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 334566c 083/459: Support emacs binary being installed to path with whitespace., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c9e1aa9 081/459: Merge pull request #29 from josteink/compilation-regexps, ELPA Syncer, 2021/08/22