]> git.eshelyaron.com Git - emacs.git/commitdiff
Add tests for the last two keywords
authorJohn Wiegley <johnw@newartisans.com>
Fri, 1 Dec 2017 19:16:19 +0000 (11:16 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Fri, 1 Dec 2017 19:16:19 +0000 (11:16 -0800)
test/lisp/use-package/use-package-tests.el

index 7c860f568a0d6b6d0625ec3a9f6fff9f355b3107..3db6f19e901a94e619c446f47a8138fc3f3f2e14 100644 (file)
@@ -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])
 
              (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)