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

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

[elpa] externals/csharp-mode 7c196b7 144/459: Added a minimal imenu name


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 7c196b7 144/459: Added a minimal imenu namespace test.
Date: Sun, 22 Aug 2021 13:59:14 -0400 (EDT)

branch: externals/csharp-mode
commit 7c196b722e6df8450931af96a0c2c11e50d9e999
Author: Shawn Hoover <shawn@xia.com>
Commit: Shawn Hoover <shawn@xia.com>

    Added a minimal imenu namespace test.
---
 csharp-mode-tests.el               | 9 +++++++++
 test-files/imenu-namespace-test.cs | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/csharp-mode-tests.el b/csharp-mode-tests.el
index 8898992..bb066e8 100644
--- a/csharp-mode-tests.el
+++ b/csharp-mode-tests.el
@@ -212,6 +212,15 @@
     (should (string-match-p "prop IImenuTest.InterfaceString" imenu-items))
     (kill-buffer buffer)))
 
+(ert-deftest imenu-parsing-supports-namespace ()
+  (let* ((find-file-hook nil) ;; avoid vc-mode file-hooks when opening!
+         (buffer         (find-file-read-only 
"./test-files/imenu-namespace-test.cs"))
+         (imenu-index    (csharp--imenu-create-index-helper nil "" t t)) ;; 
same line as in `csharp-imenu-create-index'.
+         (ns-entry       (cadr imenu-index))
+         (ns-item        (car ns-entry)))
+    (should (string-match-p "namespace ImenuTest" ns-item))
+    (kill-buffer buffer)))
+
 (defvar csharp-hook1 nil)
 (defvar csharp-hook2 nil)
 
diff --git a/test-files/imenu-namespace-test.cs 
b/test-files/imenu-namespace-test.cs
new file mode 100644
index 0000000..3411281
--- /dev/null
+++ b/test-files/imenu-namespace-test.cs
@@ -0,0 +1,5 @@
+using System;
+
+namespace ImenuTest
+{
+}



reply via email to

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