]> git.eshelyaron.com Git - emacs.git/commitdiff
package-tests.el: Add test for last change
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 26 May 2023 16:23:59 +0000 (12:23 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 26 May 2023 16:23:59 +0000 (12:23 -0400)
* test/lisp/emacs-lisp/package-tests.el (package-test-desc-from-buffer):
Make sure the absence of the terminating comment does not matter.

test/lisp/emacs-lisp/package-tests.el

index 0016fb586b701e72ec3aa790b5be888f189a3b1c..113b4ec12a8c2194810d08610125b64467aaa07b 100644 (file)
@@ -219,9 +219,14 @@ Must called from within a `tar-mode' buffer."
 
 (ert-deftest package-test-desc-from-buffer ()
   "Parse an elisp buffer to get a `package-desc' object."
-  (with-package-test (:basedir (ert-resource-directory) :file "simple-single-1.3.el")
-    (should (package-test--compatible-p
-             (package-buffer-info) simple-single-desc 'kind)))
+  (with-package-test (:basedir (ert-resource-directory)
+                      :file "simple-single-1.3.el")
+    (let ((pi (package-buffer-info)))
+      (should (package-test--compatible-p pi simple-single-desc 'kind))
+      ;; The terminating line is not mandatory any more.
+      (re-search-forward "^;;; .* ends here")
+      (delete-region (match-beginning 0) (point-max))
+      (should (equal (package-buffer-info) pi))))
   (with-package-test (:basedir (ert-resource-directory) :file "simple-depend-1.0.el")
     (should (package-test--compatible-p
              (package-buffer-info) simple-depend-desc 'kind)))