summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/package-tests.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2019-10-20 23:49:18 +0200
committerStefan Kangas <stefankangas@gmail.com>2019-10-21 00:00:36 +0200
commit0e6f4628d8fff53505e4399e71da9f531a64fff7 (patch)
tree22b587b6b12cba555590d22f586b94d5eccd30c1 /test/lisp/emacs-lisp/package-tests.el
parent78cb3791fa11c95756ee3917c63cfea774f128a2 (diff)
downloademacs-0e6f4628d8fff53505e4399e71da9f531a64fff7.tar.gz
Don't try to add nil packages on refresh
* lisp/emacs-lisp/package.el (package-read-archive-contents): Don't try to add nil entries. Warn instead. (Bug#28502) * test/lisp/emacs-lisp/package-tests.el (package-test-update-archives/ignore-nil-entry): New test. * test/lisp/emacs-lisp/package-resources/with-nil-entry/archive-contents: New file.
Diffstat (limited to 'test/lisp/emacs-lisp/package-tests.el')
-rw-r--r--test/lisp/emacs-lisp/package-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
index 8670e6f3fac..828c456842a 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -452,6 +452,16 @@ Must called from within a `tar-mode' buffer."
(search-forward-regexp "^ +simple-single" nil t))))
(if (process-live-p process) (kill-process process)))))
+(ert-deftest package-test-update-archives/ignore-nil-entry ()
+ "Ignore any packages that are nil. Test for Bug#28502."
+ (with-package-test ()
+ (let* ((with-nil-entry (expand-file-name "package-resources/with-nil-entry"
+ package-test-file-dir))
+ (package-archives `(("with-nil-entry" . ,with-nil-entry))))
+ (package-initialize)
+ (package-refresh-contents)
+ (should (equal (length package-archive-contents) 2)))))
+
(ert-deftest package-test-describe-package ()
"Test displaying help for a package."