diff options
author | Pieter van Oostrum <pieter@vanoostrum.org> | 2020-03-05 20:20:04 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2020-05-09 18:19:35 +0200 |
commit | 196bc13b7bc5a29fa4d27e83d7cf0db4d99aa8b7 (patch) | |
tree | 7ef40724ff11cf06a6c63c6be063a615ee274da8 /test/lisp/emacs-lisp/package-tests.el | |
parent | e59f697cd589e2b68bccb752787ad4a8c9da375d (diff) | |
download | emacs-196bc13b7bc5a29fa4d27e83d7cf0db4d99aa8b7.tar.gz emacs-196bc13b7bc5a29fa4d27e83d7cf0db4d99aa8b7.tar.bz2 emacs-196bc13b7bc5a29fa4d27e83d7cf0db4d99aa8b7.zip |
Add new filter command to Package Menu (Bug#39903)
* lisp/emacs-lisp/package.el
(package-menu-filter-marked): New filter command.
* test/lisp/emacs-lisp/package-tests.el
(package-test-list-filter-marked): New test.
(package-menu-mode-menu):
(package-menu-mode-map): Update menu to include new filter command.
* doc/emacs/package.texi (Package Menu): Document the new command.
* etc/NEWS: Announce the new command.
Diffstat (limited to 'test/lisp/emacs-lisp/package-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 15 |
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 c0ed82c474a..732bf5e061f 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el @@ -413,6 +413,21 @@ Must called from within a `tar-mode' buffer." ;; No installed packages in default environment. (should-error (package-menu-filter-by-status "installed")))) +(ert-deftest package-test-list-filter-marked () + "Ensure package list is filtered correctly by non-empty mark." + (with-package-test () + (let ((buf (package-list-packages))) + (revert-buffer) + (search-forward-regexp "^ +simple-single") + (package-menu-mark-install) + (package-menu-filter-marked) + (goto-char (point-min)) + (should (re-search-forward "^I +simple-single" nil t)) + (should (= (count-lines (point-min) (point-max)) 1)) + (package-menu-mark-unmark) + ;; No marked packages in default environment. + (should-error (package-menu-filter-marked))))) + (ert-deftest package-test-list-filter-by-version () (with-package-menu-test (should-error (package-menu-filter-by-version "1.1" 'unknown-symbol))) ) |