diff options
| author | Daiki Ueno <ueno@gnu.org> | 2016-01-30 06:53:31 +0900 |
|---|---|---|
| committer | Daiki Ueno <ueno@gnu.org> | 2016-01-30 06:53:31 +0900 |
| commit | f3c2b2284e63ce7de90ca9335792bf6c570fc99b (patch) | |
| tree | 4407d04165534ec8cb2d7a0dd84dfdb0c2e90647 | |
| parent | 2136dd551ac21455fc7dcee43d0e4ec79fa05c3f (diff) | |
tests: Add snippt tests
| -rw-r--r-- | 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")))))) |
