diff options
| author | Steven Allen | 2023-05-16 16:07:36 -0700 |
|---|---|---|
| committer | Eli Zaretskii | 2023-06-03 10:27:46 +0300 |
| commit | 8d6dd1682e2d42a813f9649e70da7aa7d6a95021 (patch) | |
| tree | eb50cb66a88dc63af10031e6c3d230c45d9048ee /test | |
| parent | f947a0219bb6e43966e0e4e61ad6a15b0ed13e18 (diff) | |
| download | emacs-8d6dd1682e2d42a813f9649e70da7aa7d6a95021.tar.gz emacs-8d6dd1682e2d42a813f9649e70da7aa7d6a95021.zip | |
Fix use-package :vc keyword when byte-compiled
* lisp/use-package/use-package-core.el (use-package-handler/:vc):
Return the new 'body'. Otherwise, the entire package declaration gets
dropped when byte-compiling.
* test/lisp/use-package/use-package-tests.el
(use-package-test-handler/:vc-6): test it.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/use-package/use-package-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index c8c20fc51cb..9181a8171a7 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el | |||
| @@ -1991,6 +1991,17 @@ | |||
| 1991 | (use-package-vc-install '(other-name) ,load-path?) | 1991 | (use-package-vc-install '(other-name) ,load-path?) |
| 1992 | (require 'foo nil nil))))) | 1992 | (require 'foo nil nil))))) |
| 1993 | 1993 | ||
| 1994 | (ert-deftest use-package-test-handler/:vc-6 () | ||
| 1995 | (let ((byte-compile-current-file "use-package-core.el") | ||
| 1996 | tried-to-install) | ||
| 1997 | (cl-letf (((symbol-function #'use-package-vc-install) | ||
| 1998 | (lambda (arg &optional local-path) | ||
| 1999 | (setq tried-to-install arg)))) | ||
| 2000 | (should (equal | ||
| 2001 | (use-package-handler/:vc 'foo nil 'some-pkg '(:init (foo)) nil) | ||
| 2002 | '(foo))) | ||
| 2003 | (should (eq tried-to-install 'some-pkg))))) | ||
| 2004 | |||
| 1994 | (ert-deftest use-package-test-normalize/:vc () | 2005 | (ert-deftest use-package-test-normalize/:vc () |
| 1995 | (should (equal '(foo "version-string") | 2006 | (should (equal '(foo "version-string") |
| 1996 | (use-package-normalize/:vc 'foo :vc '("version-string")))) | 2007 | (use-package-normalize/:vc 'foo :vc '("version-string")))) |