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

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

[elpa] externals/mmm-mode c45140dc16 16/17: Add test to verify mmm-versi


From: ELPA Syncer
Subject: [elpa] externals/mmm-mode c45140dc16 16/17: Add test to verify mmm-version, variable and function
Date: Wed, 21 Feb 2024 09:58:28 -0500 (EST)

branch: externals/mmm-mode
commit c45140dc16771ce59a49ac2b291ceae563b846d0
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Add test to verify mmm-version, variable and function
---
 Makefile           |  2 +-
 tests/variables.el | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 65b478e734..1813a2e29e 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ ELFILES = mmm-auto.el mmm-class.el mmm-cmds.el mmm-compat.el 
mmm-cweb.el \
           mmm-noweb.el mmm-region.el mmm-rpm.el mmm-sample.el mmm-univ.el \
           mmm-utils.el mmm-vars.el
 ELCFILES = $(ELFILES:.el=.elc)
-TESTS = highlighting.el html-erb.el
+TESTS = highlighting.el html-erb.el variables.el
 
 all: mmm.info $(ELCFILES)
 
diff --git a/tests/variables.el b/tests/variables.el
new file mode 100644
index 0000000000..d33886f9d4
--- /dev/null
+++ b/tests/variables.el
@@ -0,0 +1,39 @@
+;;; variables.el --- Tests for mmm-mode variables -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024  Free Software Foundation, Inc.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Tests for the mmm-vars file.
+
+;;; Code:
+
+(require 'mmm-vars)
+(require 'mmm-mode)
+(require 'lisp-mnt)
+
+(ert-deftest verify-mmm-version ()
+  "Verify variable `mmm-version' and function `mmm-version'.
+Both should match the Version header in mmm-mode.el."
+  ;; Find the correct path to the mmm-mode.el file (which contain the
+  ;; `Version:' header) by finding using the name of the file where
+  ;; `mmm-mode' is defined.
+  (let ((lmver (lm-version (find-lisp-object-file-name 'mmm-mode nil)))
+       (inhibit-message t)) ; don't print (mmm-version)
+    (should (string= lmver mmm-version))
+    (should (string-match (regexp-quote lmver) (mmm-version)))))
+
+;;; variables.el ends here



reply via email to

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