[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode b061f8a 104/459: Add unit-test for indentat
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode b061f8a 104/459: Add unit-test for indentation. |
Date: |
Sun, 22 Aug 2021 13:59:06 -0400 (EDT) |
branch: externals/csharp-mode
commit b061f8aedb28ad7c05251244640763612ba7dae7
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Add unit-test for indentation.
---
csharp-mode-tests.el | 11 +++++++
test-files/indentation-tests.cs | 69 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 21156ba..3db42f1 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -139,4 +139,15 @@
(should (equal t (and csharp-hook1
csharp-hook2)))))
+(ert-deftest indentation-rules-should-be-as-specified-in-test-doc ()
+ (let* ((buffer (find-file "test-files/indentation-tests.cs")))
+ ;; double-ensure mode is active
+ (csharp-mode)
+
+ (setq orig-content (buffer-substring-no-properties (point-min)
(point-max)))
+ (indent-region (point-min) (point-max))
+ (setq indented-content (buffer-substring-no-properties (point-min)
(point-max)))
+
+ (should (equal orig-content indented-content))))
+
;;(ert-run-tests-interactively t)
diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs
new file mode 100644
index 0000000..d054655
--- /dev/null
+++ b/test-files/indentation-tests.cs
@@ -0,0 +1,69 @@
+using System;
+
+/* comment block
+ on namespace test */
+namespace Boo
+{
+ // comment on class test
+ public class Foo
+ {
+ // auto-property-test
+ public bool AutoProperty { get; set; }
+
+ // regular property-test
+ public bool Property
+ {
+ get
+ {
+ return true;
+ }
+ set
+ {
+ // ignored
+ }
+ }
+
+ /// <summary>
+ /// Codedoc on method-test
+ /// </summary>
+ public void Foo(string a = "hkfdhkd", string b = "bbbbbb")
+ {
+ // OK!
+ }
+
+ public void Test()
+ {
+ if (test)
+ {
+
+ }
+
+ if (test2) {
+ // should work too
+ bool b = true;
+ }
+
+ var x = new {
+ adhoc = object,
+ with = new prop(),
+ };
+
+ var map = new Dictionary<int,string> {
+ { 1, "true" },
+ { 2, "false" },
+ };
+
+ // indents incorrectly! :(
+ // var map2 = new Dictionary<int,string>
+ // {
+ // { 1, "true" },
+ // { 2, "false" },
+ // };
+
+ using (test)
+ {
+ System.Console.WriteLine("boo");
+ }
+ }
+ }
+}
- [elpa] externals/csharp-mode 8e8c804 061/459: Fix test., (continued)
- [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
- [elpa] externals/csharp-mode f1cd209 091/459: fontify var as a typeless declaration, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a854be8 094/459: Bump version., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode d85cc3d 103/459: Add unit-test for hooks during mode-activation., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8dd56f4 100/459: Reproduce issue #42., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 5ecae8b 099/459: Add support for devenv compilation-output., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b061f8a 104/459: Add unit-test for indentation.,
ELPA Syncer <=
- [elpa] externals/csharp-mode 831bd53 108/459: Fix "make clean"., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ba36d6c 105/459: Replace `flet` with `letrec`, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 494cbd9 106/459: Merge pull request #45 from wasamasa/fix-flet-warning, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a182957 112/459: Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 03e6200 109/459: Emacs: Tentative fix for fontification issues., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 64eb7db 114/459: Merge pull request #47 from josteink/feature-cl-lib, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 165a128 028/459: Update maintainer-ship and new repo-URL., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ac6a1ff 036/459: Don't package stuff we only need for the build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f000c97 037/459: Add link to Travis., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0762f78 038/459: remove the debug (message "Loading ...") forms, ELPA Syncer, 2021/08/22