From cb846d188ab401bbac216e0d20fba72ad8c208b7 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 1 Dec 2017 11:16:19 -0800 Subject: [PATCH] Add tests for the last two keywords --- test/lisp/use-package/use-package-tests.el | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index 7c860f568a0..3db6f19e901 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -30,7 +30,7 @@ use-package-expand-minimally t max-lisp-eval-depth 8000) -;; (let ((byte-compile-current-file nil)) (expand-minimally ()) +;; (let ((byte-compile-current-file nil)) (expand-minimally ())) (fset 'insert-expansion [?\C-\M- ?\M-w ?\M-: ?\M-p ?\C-e ?\C-b ?\C-b ?\C-\M-b ?\C-y ?\C-\M-k return ?\C-\M- ?\M-w C-return ?\C-z ?\C-n ?\C-f ?\C-y ?\C-\M-k]) @@ -160,13 +160,24 @@ (config) t)))))) -;; (ert-deftest use-package-test/:pin () -;; (should (equal (macroexpand (use-package)) -;; '()))) +(ert-deftest use-package-test/:pin () + (match-expansion + (use-package foo :pin foo) + `(progn + (use-package-pin-package 'foo "foo") + (require 'foo nil 'nil))) + + (match-expansion + (use-package foo :pin "foo") + `(progn + (use-package-pin-package 'foo "foo") + (require 'foo nil 'nil)))) -;; (ert-deftest use-package-test/:defer-install () -;; (should (equal (macroexpand (use-package)) -;; '()))) +(ert-deftest use-package-test/:defer-install () + (match-expansion + (use-package foo :defer-install t) + `(progn + (require 'foo nil 'nil)))) (ert-deftest use-package-test-normalize/:ensure () (flet ((norm (&rest args) -- 2.39.2