mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Separate out all tests, the better to identify which one failed
This commit is contained in:
parent
4c1b82aed5
commit
e5aa510d48
1 changed files with 169 additions and 106 deletions
|
|
@ -122,19 +122,20 @@
|
|||
(should (equal (use-package--normalize-function "Hello") "Hello"))
|
||||
(should (equal (use-package--normalize-function '(nil . nil)) '(nil . nil))))
|
||||
|
||||
(ert-deftest use-package-test/:disabled ()
|
||||
(ert-deftest use-package-test/:disabled-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :disabled t)
|
||||
`()))
|
||||
|
||||
(ert-deftest use-package-test/:preface ()
|
||||
(ert-deftest use-package-test/:preface-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :preface (t))
|
||||
`(progn
|
||||
(eval-and-compile
|
||||
(t))
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:preface-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :preface (t))
|
||||
|
|
@ -145,8 +146,9 @@
|
|||
"Cannot load foo: %S" nil
|
||||
(load "foo" nil t)))
|
||||
(t))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:preface-3 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo
|
||||
|
|
@ -167,8 +169,9 @@
|
|||
(init)
|
||||
(require 'foo nil nil)
|
||||
(config)
|
||||
t)))
|
||||
t))))
|
||||
|
||||
(ert-deftest use-package-test/:preface-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo
|
||||
|
|
@ -193,24 +196,20 @@
|
|||
(config)
|
||||
t))))))
|
||||
|
||||
(ert-deftest use-package-test/:pin ()
|
||||
(ert-deftest use-package-test/:pin-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :pin foo)
|
||||
`(progn
|
||||
(use-package-pin-package 'foo "foo")
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:pin-2 ()
|
||||
(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 ()
|
||||
(match-expansion
|
||||
(use-package foo :defer-install t)
|
||||
`(require 'foo nil nil)))
|
||||
|
||||
(ert-deftest use-package-test-normalize/:ensure ()
|
||||
(flet ((norm (&rest args)
|
||||
(apply #'use-package-normalize/:ensure
|
||||
|
|
@ -221,51 +220,57 @@
|
|||
(should-error (norm '(1)))
|
||||
(should-error (norm '("Hello")))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure ()
|
||||
(ert-deftest use-package-test/:ensure-1 ()
|
||||
(let ((use-package-always-ensure nil))
|
||||
(match-expansion
|
||||
(use-package foo :ensure t)
|
||||
`(progn
|
||||
(use-package-ensure-elpa 'foo 't 'nil)
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-2 ()
|
||||
(let ((use-package-always-ensure t))
|
||||
(match-expansion
|
||||
(use-package foo :ensure t)
|
||||
`(progn
|
||||
(use-package-ensure-elpa 'foo 't 'nil)
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-3 ()
|
||||
(let ((use-package-always-ensure nil))
|
||||
(match-expansion
|
||||
(use-package foo :ensure nil)
|
||||
`(progn
|
||||
(use-package-ensure-elpa 'foo 'nil 'nil)
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-4 ()
|
||||
(let ((use-package-always-ensure t))
|
||||
(match-expansion
|
||||
(use-package foo :ensure nil)
|
||||
`(progn
|
||||
(use-package-ensure-elpa 'foo 'nil 'nil)
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-5 ()
|
||||
(let ((use-package-always-ensure nil))
|
||||
(match-expansion
|
||||
(use-package foo :load-path "foo")
|
||||
`(progn
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-6 ()
|
||||
(let ((use-package-always-ensure t))
|
||||
(match-expansion
|
||||
(use-package foo :load-path "foo")
|
||||
`(progn
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-7 ()
|
||||
(let ((use-package-always-ensure nil))
|
||||
(match-expansion
|
||||
(use-package foo :ensure nil :load-path "foo")
|
||||
|
|
@ -273,8 +278,9 @@
|
|||
(use-package-ensure-elpa 'foo 'nil 'nil)
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-8 ()
|
||||
(let ((use-package-always-ensure t))
|
||||
(match-expansion
|
||||
(use-package foo :ensure nil :load-path "foo")
|
||||
|
|
@ -282,8 +288,9 @@
|
|||
(use-package-ensure-elpa 'foo 'nil 'nil)
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-9 ()
|
||||
(let ((use-package-always-ensure nil))
|
||||
(match-expansion
|
||||
(use-package foo :ensure t :load-path "foo")
|
||||
|
|
@ -291,8 +298,9 @@
|
|||
(use-package-ensure-elpa 'foo 't 'nil)
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-10 ()
|
||||
(let ((use-package-always-ensure t))
|
||||
(match-expansion
|
||||
(use-package foo :ensure t :load-path "foo")
|
||||
|
|
@ -300,8 +308,9 @@
|
|||
(use-package-ensure-elpa 'foo 't 'nil)
|
||||
(eval-and-compile
|
||||
(add-to-list 'load-path ,(pred stringp)))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:ensure-11 ()
|
||||
(let (tried-to-install)
|
||||
(flet ((use-package-ensure-elpa
|
||||
(name ensure state &optional no-refresh)
|
||||
|
|
@ -311,60 +320,67 @@
|
|||
(use-package foo :ensure t)
|
||||
(should (eq tried-to-install 'foo)))))
|
||||
|
||||
(ert-deftest use-package-test/:if ()
|
||||
(ert-deftest use-package-test/:if-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :if t)
|
||||
`(when t
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:if-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :if (and t t))
|
||||
`(when (and t t)
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:if-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :if nil)
|
||||
`(when nil
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:when ()
|
||||
(ert-deftest use-package-test/:when-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :when t)
|
||||
`(when t
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:when-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :when (and t t))
|
||||
`(when (and t t)
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:when-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :when nil)
|
||||
`(when nil
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:unless ()
|
||||
(ert-deftest use-package-test/:unless-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :unless t)
|
||||
`(when (not t)
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:unless-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :unless (and t t))
|
||||
`(when (not (and t t))
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:unless-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :unless nil)
|
||||
`(unless nil
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:requires ()
|
||||
(ert-deftest use-package-test/:requires-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :requires bar)
|
||||
`(when (featurep 'bar)
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:requires-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :requires bar)
|
||||
|
|
@ -374,13 +390,15 @@
|
|||
(with-demoted-errors
|
||||
"Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:requires-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :requires (bar quux))
|
||||
`(when (not (member nil (mapcar #'featurep '(bar quux))))
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:requires-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :requires bar)
|
||||
|
|
@ -391,7 +409,7 @@
|
|||
(load "foo" nil t))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:load-path ()
|
||||
(ert-deftest use-package-test/:load-path-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :load-path "bar")
|
||||
`(progn
|
||||
|
|
@ -401,8 +419,9 @@
|
|||
#'string=
|
||||
(expand-file-name
|
||||
"bar" user-emacs-directory)))))
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:load-path-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :load-path "bar")
|
||||
|
|
@ -417,8 +436,9 @@
|
|||
(eval-when-compile
|
||||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:load-path-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :load-path ("bar" "quux"))
|
||||
`(progn
|
||||
|
|
@ -434,8 +454,9 @@
|
|||
#'string=
|
||||
(expand-file-name
|
||||
"quux" user-emacs-directory)))))
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:load-path-4 ()
|
||||
(match-expansion
|
||||
(use-package foo :load-path (lambda () (list "bar" "quux")))
|
||||
`(progn
|
||||
|
|
@ -453,17 +474,19 @@
|
|||
"quux" user-emacs-directory)))))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:no-require ()
|
||||
(ert-deftest use-package-test/:no-require-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :no-require t)
|
||||
`nil)
|
||||
`nil))
|
||||
|
||||
(ert-deftest use-package-test/:no-require-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :no-require t :config (config))
|
||||
`(progn
|
||||
(config)
|
||||
t))
|
||||
t)))
|
||||
|
||||
(ert-deftest use-package-test/:no-require-3 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :no-require t)
|
||||
|
|
@ -483,7 +506,7 @@
|
|||
(should-error (norm '("foo" . 99)))
|
||||
(should-error (norm '(99 . sym)))))
|
||||
|
||||
(ert-deftest use-package-test/:bind ()
|
||||
(ert-deftest use-package-test/:bind-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :bind ("C-k" . key))
|
||||
`(progn
|
||||
|
|
@ -492,7 +515,7 @@
|
|||
(ignore
|
||||
(bind-keys :package foo ("C-k" . key))))))
|
||||
|
||||
(ert-deftest use-package-test/:bind* ()
|
||||
(ert-deftest use-package-test/:bind*-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :bind* ("C-k" . key))
|
||||
`(progn
|
||||
|
|
@ -501,7 +524,7 @@
|
|||
(ignore
|
||||
(bind-keys* :package foo ("C-k" . key))))))
|
||||
|
||||
(ert-deftest use-package-test/:bind-keymap ()
|
||||
(ert-deftest use-package-test/:bind-keymap-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :bind-keymap ("C-k" . key))
|
||||
`(ignore
|
||||
|
|
@ -510,7 +533,7 @@
|
|||
(interactive)
|
||||
(use-package-autoload-keymap 'key 'foo nil))))))
|
||||
|
||||
(ert-deftest use-package-test/:bind-keymap* ()
|
||||
(ert-deftest use-package-test/:bind-keymap*-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :bind-keymap* ("C-k" . key))
|
||||
`(ignore
|
||||
|
|
@ -519,14 +542,15 @@
|
|||
(interactive)
|
||||
(use-package-autoload-keymap 'key 'foo t))))))
|
||||
|
||||
(ert-deftest use-package-test/:interpreter ()
|
||||
(ert-deftest use-package-test/:interpreter-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :interpreter "interp")
|
||||
`(progn
|
||||
(add-to-list 'interpreter-mode-alist '("interp" . foo))
|
||||
(unless (fboundp 'foo)
|
||||
(autoload #'foo "foo" nil t))))
|
||||
(autoload #'foo "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:interpreter-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :interpreter ("interp" . fun))
|
||||
`(progn
|
||||
|
|
@ -549,14 +573,15 @@
|
|||
(should (equal (norm '((".foo" . foo) (".bar" . bar)))
|
||||
'((".foo" . foo) (".bar" . bar))))))
|
||||
|
||||
(ert-deftest use-package-test/:mode ()
|
||||
(ert-deftest use-package-test/:mode-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :mode "interp")
|
||||
`(progn
|
||||
(add-to-list 'auto-mode-alist '("interp" . foo))
|
||||
(unless (fboundp 'foo)
|
||||
(autoload #'foo "foo" nil t))))
|
||||
(autoload #'foo "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:mode-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :mode ("interp" . fun))
|
||||
`(progn
|
||||
|
|
@ -564,14 +589,15 @@
|
|||
(unless (fboundp 'fun)
|
||||
(autoload #'fun "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:magic ()
|
||||
(ert-deftest use-package-test/:magic-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :magic "interp")
|
||||
`(progn
|
||||
(add-to-list 'magic-mode-alist '("interp" . foo))
|
||||
(unless (fboundp 'foo)
|
||||
(autoload #'foo "foo" nil t))))
|
||||
(autoload #'foo "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:magic-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :magic ("interp" . fun))
|
||||
`(progn
|
||||
|
|
@ -579,14 +605,15 @@
|
|||
(unless (fboundp 'fun)
|
||||
(autoload #'fun "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:magic-fallback ()
|
||||
(ert-deftest use-package-test/:magic-fallback-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :magic-fallback "interp")
|
||||
`(progn
|
||||
(add-to-list 'magic-fallback-mode-alist '("interp" . foo))
|
||||
(unless (fboundp 'foo)
|
||||
(autoload #'foo "foo" nil t))))
|
||||
(autoload #'foo "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:magic-fallback-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :magic-fallback ("interp" . fun))
|
||||
`(progn
|
||||
|
|
@ -594,20 +621,22 @@
|
|||
(unless (fboundp 'fun)
|
||||
(autoload #'fun "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:commands ()
|
||||
(ert-deftest use-package-test/:commands-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :commands bar)
|
||||
`(unless (fboundp 'bar)
|
||||
(autoload #'bar "foo" nil t)))
|
||||
(autoload #'bar "foo" nil t))))
|
||||
|
||||
(ert-deftest use-package-test/:commands-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :commands (bar quux))
|
||||
`(progn
|
||||
(unless (fboundp 'bar)
|
||||
(autoload #'bar "foo" nil t))
|
||||
(unless (fboundp 'quux)
|
||||
(autoload #'quux "foo" nil t))))
|
||||
(autoload #'quux "foo" nil t)))))
|
||||
|
||||
(ert-deftest use-package-test/:commands-3 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :commands (bar quux))
|
||||
|
|
@ -625,11 +654,12 @@
|
|||
(eval-when-compile
|
||||
(declare-function quux "foo"))))))
|
||||
|
||||
(ert-deftest use-package-test/:defines ()
|
||||
(ert-deftest use-package-test/:defines-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :defines bar)
|
||||
`(require 'foo nil nil))
|
||||
`(require 'foo nil nil)))
|
||||
|
||||
(ert-deftest use-package-test/:defines-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :defines bar)
|
||||
|
|
@ -642,11 +672,12 @@
|
|||
(load "foo" nil t))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:functions ()
|
||||
(ert-deftest use-package-test/:functions-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :functions bar)
|
||||
`(require 'foo nil nil))
|
||||
`(require 'foo nil nil)))
|
||||
|
||||
(ert-deftest use-package-test/:functions-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :functions bar)
|
||||
|
|
@ -657,12 +688,14 @@
|
|||
(with-demoted-errors
|
||||
"Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:functions-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :defer t :functions bar)
|
||||
`nil)
|
||||
`nil))
|
||||
|
||||
(ert-deftest use-package-test/:functions-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :defer t :functions bar)
|
||||
|
|
@ -670,8 +703,9 @@
|
|||
(declare-function bar "foo")
|
||||
(eval-when-compile
|
||||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))))
|
||||
(load "foo" nil t)))))))
|
||||
|
||||
(ert-deftest use-package-test/:functions-5 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :defer t :config (config) :functions bar)
|
||||
|
|
@ -687,11 +721,12 @@
|
|||
(config)
|
||||
t))))))
|
||||
|
||||
(ert-deftest use-package-test/:defer ()
|
||||
(ert-deftest use-package-test/:defer-1 ()
|
||||
(match-expansion
|
||||
(use-package foo)
|
||||
`(require 'foo nil nil))
|
||||
`(require 'foo nil nil)))
|
||||
|
||||
(ert-deftest use-package-test/:defer-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo)
|
||||
|
|
@ -700,12 +735,14 @@
|
|||
(eval-when-compile
|
||||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:defer-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :defer t)
|
||||
`nil)
|
||||
`nil))
|
||||
|
||||
(ert-deftest use-package-test/:defer-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :defer t)
|
||||
|
|
@ -734,7 +771,7 @@
|
|||
(should (equal (norm '(((bar1 bar2) . baz) ((quux1 quux2) . bow)))
|
||||
'(((bar1 bar2) . baz) ((quux1 quux2) . bow))))))
|
||||
|
||||
(ert-deftest use-package-test/:hook ()
|
||||
(ert-deftest use-package-test/:hook-1 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(should
|
||||
(equal
|
||||
|
|
@ -773,27 +810,28 @@
|
|||
;; '((foo bar baz))))
|
||||
))
|
||||
|
||||
(ert-deftest use-package-test/:custom ()
|
||||
(ert-deftest use-package-test/:custom-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :custom (foo bar))
|
||||
`(progn
|
||||
(customize-set-variable 'foo bar "Customized with use-package foo")
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:custom-face ()
|
||||
(ert-deftest use-package-test/:custom-face-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :custom-face (foo ((t (:background "#e4edfc")))))
|
||||
`(progn
|
||||
(custom-set-faces '(foo ((t (:background "#e4edfc")))))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:init ()
|
||||
(ert-deftest use-package-test/:init-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :init (init))
|
||||
`(progn
|
||||
(init)
|
||||
(require 'foo nil nil)))
|
||||
(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:init-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :init (init))
|
||||
|
|
@ -805,12 +843,13 @@
|
|||
(init)
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:after ()
|
||||
(ert-deftest use-package-test/:after-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :after bar)
|
||||
`(eval-after-load 'bar
|
||||
'(require 'foo nil nil)))
|
||||
'(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:after-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :after bar)
|
||||
|
|
@ -820,20 +859,23 @@
|
|||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(eval-after-load 'bar
|
||||
'(require 'foo nil nil)))))
|
||||
'(require 'foo nil nil))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (bar quux))
|
||||
`(eval-after-load 'quux
|
||||
'(eval-after-load 'bar
|
||||
'(require 'foo nil nil))))
|
||||
'(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:after-4 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:all bar quux))
|
||||
`(eval-after-load 'quux
|
||||
'(eval-after-load 'bar
|
||||
'(require 'foo nil nil))))
|
||||
'(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:after-5 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:any bar quux))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -842,8 +884,9 @@
|
|||
(eval-after-load 'bar
|
||||
`(funcall ,_))
|
||||
(eval-after-load 'quux
|
||||
`(funcall ,_))))))
|
||||
`(funcall ,_)))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-6 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:all (:any bar quux) bow))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -853,8 +896,9 @@
|
|||
(eval-after-load 'bar
|
||||
`(funcall ,_))
|
||||
(eval-after-load 'quux
|
||||
`(funcall ,_)))))))
|
||||
`(funcall ,_))))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-7 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:any (:all bar quux) bow))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -864,8 +908,9 @@
|
|||
'(eval-after-load 'bar
|
||||
`(funcall ,_)))
|
||||
(eval-after-load 'bow
|
||||
`(funcall ,_))))))
|
||||
`(funcall ,_)))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-8 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:all (:any bar quux) (:any bow baz)))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -882,8 +927,9 @@
|
|||
(eval-after-load 'bar
|
||||
`(funcall ,_))
|
||||
(eval-after-load 'quux
|
||||
`(funcall ,_))))))))
|
||||
`(funcall ,_)))))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-9 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:any (:all bar quux) (:all bow baz)))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -894,8 +940,9 @@
|
|||
`(funcall ,_)))
|
||||
(eval-after-load 'baz
|
||||
'(eval-after-load 'bow
|
||||
`(funcall ,_)))))))
|
||||
`(funcall ,_))))))))
|
||||
|
||||
(ert-deftest use-package-test/:after-10 ()
|
||||
(match-expansion
|
||||
(use-package foo :after (:any (:all bar quux) (:any bow baz)))
|
||||
`(lexical-let ,_
|
||||
|
|
@ -910,11 +957,12 @@
|
|||
(eval-after-load 'baz
|
||||
`(funcall ,_))))))))
|
||||
|
||||
(ert-deftest use-package-test/:demand ()
|
||||
(ert-deftest use-package-test/:demand-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :demand t)
|
||||
`(require 'foo nil nil))
|
||||
`(require 'foo nil nil)))
|
||||
|
||||
(ert-deftest use-package-test/:demand-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :demand t)
|
||||
|
|
@ -923,15 +971,17 @@
|
|||
(eval-when-compile
|
||||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(require 'foo nil nil))))
|
||||
(require 'foo nil nil)))))
|
||||
|
||||
(ert-deftest use-package-test/:demand-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :demand t :config (config))
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(config)
|
||||
t))
|
||||
t)))
|
||||
|
||||
(ert-deftest use-package-test/:demand-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :demand t :config (config))
|
||||
|
|
@ -942,14 +992,16 @@
|
|||
(load "foo" nil t))))
|
||||
(require 'foo nil nil)
|
||||
(config)
|
||||
t)))
|
||||
t))))
|
||||
|
||||
(ert-deftest use-package-test/:demand-5 ()
|
||||
;; #529 - :demand should not override an explicit use of :after
|
||||
(match-expansion
|
||||
(use-package foo :demand t :after bar)
|
||||
`(eval-after-load 'bar
|
||||
'(require 'foo nil nil)))
|
||||
'(require 'foo nil nil))))
|
||||
|
||||
(ert-deftest use-package-test/:demand-6 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :demand t :after bar)
|
||||
|
|
@ -959,8 +1011,9 @@
|
|||
(with-demoted-errors "Cannot load foo: %S" nil
|
||||
(load "foo" nil t))))
|
||||
(eval-after-load 'bar
|
||||
'(require 'foo nil nil)))))
|
||||
'(require 'foo nil nil))))))
|
||||
|
||||
(ert-deftest use-package-test/:demand-7 ()
|
||||
(match-expansion
|
||||
(use-package counsel
|
||||
:load-path "site-lisp/swiper"
|
||||
|
|
@ -994,14 +1047,15 @@
|
|||
("C-*" . counsel-org-agenda-headlines)
|
||||
("M-x" . counsel-M-x))))))))
|
||||
|
||||
(ert-deftest use-package-test/:config ()
|
||||
(ert-deftest use-package-test/:config-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :config (config))
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(config)
|
||||
t))
|
||||
t)))
|
||||
|
||||
(ert-deftest use-package-test/:config-2 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :config (config))
|
||||
|
|
@ -1012,15 +1066,17 @@
|
|||
(load "foo" nil t))))
|
||||
(require 'foo nil nil)
|
||||
(config)
|
||||
t)))
|
||||
t))))
|
||||
|
||||
(ert-deftest use-package-test/:config-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :defer t :config (config))
|
||||
`(eval-after-load 'foo
|
||||
'(progn
|
||||
(config)
|
||||
t)))
|
||||
t))))
|
||||
|
||||
(ert-deftest use-package-test/:config-4 ()
|
||||
(let ((byte-compile-current-file t))
|
||||
(match-expansion
|
||||
(use-package foo :defer t :config (config))
|
||||
|
|
@ -1046,29 +1102,31 @@
|
|||
(should (equal (use-package-normalize-diminish 'foopkg :diminish '(foo . "bar"))
|
||||
'((foo . "bar")))))
|
||||
|
||||
(ert-deftest use-package-test/:diminish ()
|
||||
(ert-deftest use-package-test/:diminish-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :diminish nil)
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'diminish)
|
||||
(diminish 'foo-mode))))
|
||||
(diminish 'foo-mode)))))
|
||||
|
||||
(ert-deftest use-package-test/:diminish-2 ()
|
||||
(match-expansion
|
||||
(use-package foo :diminish bar)
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'diminish)
|
||||
(diminish 'bar))))
|
||||
(diminish 'bar)))))
|
||||
|
||||
(ert-deftest use-package-test/:diminish-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :diminish "bar")
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'diminish)
|
||||
(diminish 'foo-mode "bar"))))
|
||||
|
||||
(diminish 'foo-mode "bar")))))
|
||||
|
||||
(ert-deftest use-package-test/:diminish-4 ()
|
||||
(match-expansion
|
||||
(use-package foo :diminish (foo . "bar"))
|
||||
`(progn
|
||||
|
|
@ -1093,44 +1151,49 @@
|
|||
`((a-mode nil foo) (b-mode " b" foo))))
|
||||
(should-error (use-package-normalize/:delight 'foo :delight '((:eval 1)))))
|
||||
|
||||
(ert-deftest use-package-test/:delight ()
|
||||
(ert-deftest use-package-test/:delight-1 ()
|
||||
(match-expansion
|
||||
(use-package foo :delight)
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'delight)
|
||||
(delight '((foo-mode nil foo))))))
|
||||
(delight '((foo-mode nil foo)))))))
|
||||
|
||||
(ert-deftest use-package-test/:delight-2 ()
|
||||
(should-error
|
||||
(match-expansion
|
||||
(use-package foo :delight nil)
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'diminish)
|
||||
(diminish 'foo-mode)))))
|
||||
(diminish 'foo-mode))))))
|
||||
|
||||
(ert-deftest use-package-test/:delight-3 ()
|
||||
(match-expansion
|
||||
(use-package foo :delight bar)
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'delight)
|
||||
(delight '((bar nil foo))))))
|
||||
(delight '((bar nil foo)))))))
|
||||
|
||||
(ert-deftest use-package-test/:delight-4 ()
|
||||
(match-expansion
|
||||
(use-package foo :delight "bar")
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'delight)
|
||||
(delight '((foo-mode "bar" foo))))))
|
||||
(delight '((foo-mode "bar" foo)))))))
|
||||
|
||||
(ert-deftest use-package-test/:delight-5 ()
|
||||
(should-error
|
||||
(match-expansion
|
||||
(use-package foo :delight (foo . "bar"))
|
||||
`(progn
|
||||
(require 'foo nil nil)
|
||||
(if (fboundp 'diminish)
|
||||
(diminish 'foo "bar")))))
|
||||
(diminish 'foo "bar"))))))
|
||||
|
||||
(ert-deftest use-package-test/:delight-6 ()
|
||||
(match-expansion
|
||||
(use-package foo :delight (foo "bar"))
|
||||
`(progn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue