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

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

[elpa] master f3c2b22 15/20: tests: Add snippt tests


From: Daiki Ueno
Subject: [elpa] master f3c2b22 15/20: tests: Add snippt tests
Date: Wed, 10 Feb 2016 08:39:00 +0000

branch: master
commit f3c2b2284e63ce7de90ca9335792bf6c570fc99b
Author: Daiki Ueno <address@hidden>
Commit: Daiki Ueno <address@hidden>

    tests: Add snippt tests
---
 gnome-c-tests.el |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/gnome-c-tests.el b/gnome-c-tests.el
index a573cd3..fa13a73 100644
--- a/gnome-c-tests.el
+++ b/gnome-c-tests.el
@@ -22,6 +22,7 @@
 ;;; Code:
 
 (require 'gnome-c-align)
+(require 'gnome-c-snippet)
 
 (defconst gnome-c-test-program-1 "\
 GGpgCtx *g_gpg_ctx_new (GError **error);
@@ -129,6 +130,11 @@ int             identifier_1234567890
                      double b);
 ")
 
+(defconst gnome-c-test-program-7 "\
+G_DECLARE_FINAL_TYPE (GGpgEngineInfo, g_gpg_engine_info, G_GPG, ENGINE_INFO,
+                      GObject)
+")
+
 (ert-deftest gnome-c-test-align--guess-optimal-columns ()
   "Tests the `gnome-c-align--guess-optimal-columns'."
   (with-temp-buffer
@@ -212,3 +218,14 @@ int             identifier_1234567890
     (should (= gnome-c-align-identifier-start-column 13))
     (should (= gnome-c-align-arglist-start-column 40))
     (should (= gnome-c-align-arglist-identifier-start-column 57))))
+
+(ert-deftest gnome-c-test-snippet-guess-name-from-declaration ()
+  "Tests the `gnome-c-snippet--guess-name-from-declaration'."
+  (with-temp-buffer
+    (insert gnome-c-test-program-7)
+    (c-mode)
+    (setq buffer-file-name "gpgme-glib.h")
+    (let ((package (gnome-c-snippet--guess-name-from-declaration 'package))
+         (class (gnome-c-snippet--guess-name-from-declaration 'class)))
+      (should (equal package '("G" "Gpg")))
+      (should (equal class '("Engine" "Info"))))))



reply via email to

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