summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMatt Armstrong <matt@rfc20.org>2022-08-02 12:14:09 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-08-02 12:14:09 +0200
commit50a192795ad64d2ea49274b402cb42530a5199ca (patch)
tree8bfa4aee681589f791c548024416d66c1dc31213 /test/lisp/emacs-lisp
parent6fd1fb8a6837acde8e1c9ab26618ec0f36121c72 (diff)
downloademacs-50a192795ad64d2ea49274b402cb42530a5199ca.tar.gz
emacs-50a192795ad64d2ea49274b402cb42530a5199ca.tar.bz2
emacs-50a192795ad64d2ea49274b402cb42530a5199ca.zip
Consider built-in packages to be installed
* lisp/emacs-lisp/package.el (package-installed-p): Check for built-in packages before initialization. (bug#56877).
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/package-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
index d7a55998c20..b903cd781ba 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -638,6 +638,21 @@ but with a different end of line convention (bug#48137)."
(package-refresh-contents)
(should (equal (length package-archive-contents) 2)))))
+(ert-deftest package-test-package-installed-p ()
+ "Test package-installed-p before and after package initialization."
+ (with-package-test ()
+ ;; Verify that `package-installed-p' evaluates true for a built-in
+ ;; package, in this case `project', before package initialization.
+ (should (not package--initialized))
+ (should (package-installed-p 'project nil))
+ (should (not (package-installed-p 'imaginary-package nil)))
+
+ ;; The results don't change after package initialization.
+ (package-initialize)
+ (should package--initialized)
+ (should (package-installed-p 'project nil))
+ (should (not (package-installed-p 'imaginary-package nil)))))
+
(ert-deftest package-test-describe-package ()
"Test displaying help for a package."