;; See `use-package-handler/:ensure' for an explanation.
(if (bound-and-true-p byte-compile-current-file)
(funcall #'use-package-vc-install arg local-path) ; compile time
- (push `(use-package-vc-install ',arg ,local-path) body)))) ; runtime
+ (push `(use-package-vc-install ',arg ,local-path) body)) ; runtime
+ body))
(defun use-package-normalize--vc-arg (arg)
"Normalize possible arguments to the `:vc' keyword.
(use-package-vc-install '(other-name) ,load-path?)
(require 'foo nil nil)))))
+(ert-deftest use-package-test-handler/:vc-6 ()
+ (let ((byte-compile-current-file "use-package-core.el")
+ tried-to-install)
+ (cl-letf (((symbol-function #'use-package-vc-install)
+ (lambda (arg &optional local-path)
+ (setq tried-to-install arg))))
+ (should (equal
+ (use-package-handler/:vc 'foo nil 'some-pkg '(:init (foo)) nil)
+ '(foo)))
+ (should (eq tried-to-install 'some-pkg)))))
+
(ert-deftest use-package-test-normalize/:vc ()
(should (equal '(foo "version-string")
(use-package-normalize/:vc 'foo :vc '("version-string"))))