[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map 797c2124f8 86/97: Restructure tests
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map 797c2124f8 86/97: Restructure tests |
Date: |
Thu, 20 Jan 2022 07:59:29 -0500 (EST) |
branch: elpa/bind-map
commit 797c2124f8529a28312fe83388a400ca916b3cee
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Restructure tests
Comment out new tests that aren't working yet
---
bind-map-tests.el | 174 +++++++++++++++++++++++++++++-------------------------
1 file changed, 93 insertions(+), 81 deletions(-)
diff --git a/bind-map-tests.el b/bind-map-tests.el
index 3736725957..d9e05a54c8 100644
--- a/bind-map-tests.el
+++ b/bind-map-tests.el
@@ -22,110 +22,122 @@
(ert-deftest bind-map-test-global-keys ()
"Test binding in global maps."
- (let ((tmpmap1 (make-sparse-keymap)))
- (bind-map tmpmap1
+ (let (minor-mode-alist minor-mode-map-alist minor-mode-list)
+ (bind-map bind-map-test-map-global
:keys ("C-a")
:evil-keys ("a")
:evil-states (motion))
- (define-key tmpmap1 "a" "b")
+ (define-key bind-map-test-map-global "a" "b")
(should (keymapp (lookup-key global-map "\C-a")))
(should (string= (lookup-key global-map "\C-aa") "b"))
(should (keymapp (lookup-key evil-motion-state-map "a")))
(should (string= (lookup-key evil-motion-state-map "aa") "b"))
- (should (not (string= (lookup-key evil-visual-state-map "aa") "b")))))
+ (should (not (string= (lookup-key evil-visual-state-map "aa") "b")))
+ (with-temp-buffer
+ (evil-local-mode 1)
+ (evil-motion-state)
+ (should (string= (key-binding "\C-aa") "b")))
+ (setq bind-map-test-map-global (make-sparse-keymap)
+ bind-map-test-map-global-prefix (make-sparse-keymap))
+ (global-set-key "\C-a" nil)))
(ert-deftest bind-map-test-major-mode-keys ()
"Test binding for major-modes."
- (let ((tmpmap2 (make-sparse-keymap))
- (tmpmap2-root-map (make-sparse-keymap))
- tmpmap2-active
- tmpmap2-prefix
- bind-map-major-modes-alist
- minor-mode-alist
- minor-mode-map-alist)
+ (let (bind-map-major-modes-alist minor-mode-map-alist)
+ (bind-map bind-map-test-map-major-mode
+ :major-modes (emacs-lisp-mode)
+ :keys ("C-a")
+ :evil-keys ("a")
+ :evil-states (motion))
+ (define-key bind-map-test-map-major-mode "a" "c")
(with-temp-buffer
- (bind-map tmpmap2
- :major-modes (emacs-lisp-mode)
- :keys ("C-a")
- :evil-keys ("a")
- :evil-states (motion))
- (evil-normalize-keymaps)
(emacs-lisp-mode)
- (define-key tmpmap2 "a" "b")
- (message "%s" (pp bind-map-major-modes-alist))
- (should (equal (cdr (assoc 'tmpmap2-active bind-map-major-modes-alist))
+ (evil-normalize-keymaps)
+ (should (equal (cdr (assoc
+ 'bind-map-test-map-major-mode-active
+ bind-map-major-modes-alist))
'(emacs-lisp-mode)))
- (should tmpmap2-active)
- (should (string= (key-binding "\C-aa") "b"))
- (should (keymapp (lookup-key (evil-get-auxiliary-keymap tmpmap2-root-map
'motion) "a")))
- (should (string= (lookup-key (evil-get-auxiliary-keymap tmpmap2-root-map
'motion) "aa") "b"))
- (should (string= "b" (key-binding "\C-aa"))))))
+ (should bind-map-test-map-major-mode-active)
+ (should (string= (key-binding "\C-aa") "c"))
+ (should (keymapp (lookup-key
+ (evil-get-auxiliary-keymap
+ bind-map-test-map-major-mode-root-map 'motion) "a")))
+ (should (string= (lookup-key
+ (evil-get-auxiliary-keymap
+ bind-map-test-map-major-mode-root-map 'motion) "aa")
"c"))
+ (should (string= "c" (key-binding "\C-aa"))))
+ (setq bind-map-test-map-major-mode (make-sparse-keymap)
+ bind-map-test-map-major-mode-prefix (make-sparse-keymap))))
(ert-deftest bind-map-test-minor-mode-keys ()
"Test binding for minor-modes."
- (let ((tmpmap3 (make-sparse-keymap))
- (tmpmap3-root-map (make-sparse-keymap))
- (fake-minor-mode t)
- minor-mode-map-alist
- minor-mode-alist)
- (bind-map tmpmap3
- :minor-modes (fake-minor-mode)
+ (let (minor-mode-alist minor-mode-map-alist minor-mode-list)
+ (bind-map bind-map-test-map-minor-mode
+ :minor-modes (bind-map-test-minor-mode)
:keys ("C-a")
:evil-keys ("a")
:evil-states (motion))
- (evil-normalize-keymaps)
- (define-key tmpmap3 "a" "b")
- (should (string= (key-binding "\C-aa") "b"))))
+ (defvar bind-map-test-minor-mode)
+ (define-key bind-map-test-map-minor-mode "a" "d")
+ (let ((bind-map-test-minor-mode t))
+ (evil-normalize-keymaps)
+ (should (string= (key-binding "\C-aa") "d")))
+ (setq bind-map-test-map-minor-mode (make-sparse-keymap)
+ bind-map-test-map-major-mode-prefix (make-sparse-keymap))))
-(ert-deftest bind-map-multiple-declarations ()
- (let ((tmpmap4 (make-sparse-keymap))
- tmpmap4-root-map
- minor-mode-map-alist bind-map-major-modes-alist)
- (bind-map tmpmap4
+(ert-deftest bind-map-test-multiple-declarations ()
+ (let (bind-map-major-modes-alist minor-mode-map-alist)
+ (bind-map bind-map-test-map-mult-decl
:major-modes (mm1 mm2))
- (bind-map tmpmap4
+ (bind-map bind-map-test-map-mult-decl
:major-modes (mm3 mm4 mm5))
- (bind-map tmpmap4
+ (bind-map bind-map-test-map-mult-decl
:major-modes (mm6))
- (should (equal (cdr (assq 'tmpmap4-active bind-map-major-modes-alist))
+ (should (equal (cdr (assq 'bind-map-test-map-mult-decl-active
+ bind-map-major-modes-alist))
'(mm1 mm2 mm3 mm4 mm5 mm6)))))
-(ert-deftest bind-map-test-minor-mode-inheritance ()
- (with-temp-buffer
- (let ((tmpmap5 (make-sparse-keymap))
- (tmpmap6 (make-sparse-keymap))
- (fake-minor-mode t)
- minor-mode-alist
- minor-mode-map-alist)
- (bind-map tmpmap5
- :keys ("C-a")
- :evil-keys ("a")
- :evil-states (normal))
- (bind-map-for-mode-inherit tmpmap6 tmpmap5
- :minor-modes (fake-minor-mode))
- (define-key tmpmap6 "a" 'asdf)
- (should (string= (key-binding "\C-aa") 'asdf))
- (evil-local-mode 1)
- (evil-motion-state)
- (message "%s" evil-state)
- (should (string= (key-binding "aa") 'asdf)))))
+;; (ert-deftest bind-map-test-minor-inheritance ()
+;; (let (minor-mode-list minor-mode-map-alist minor-mode-alist)
+;; (bind-map bind-map-test-map-minor-parent
+;; :keys ("C-a")
+;; :evil-keys ("a")
+;; :evil-states (motion))
+;; (bind-map-for-mode-inherit bind-map-test-map-minor-child
+;; bind-map-test-map-minor-parent
+;; :minor-modes (bind-map-test-minor-mode-inheritance))
+;; (message "%s" (pp bind-map-test-map-minor-child-root-map))
+;; (defvar bind-map-test-minor-mode-inheritance)
+;; (define-key bind-map-test-map-minor-child "a" 'asdf)
+;; (message "%s" (pp bind-map-test-map-minor-child-root-map))
+;; (let ((bind-map-test-minor-mode-inheritance t))
+;; (message "%s" (pp bind-map-test-map-minor-child-root-map))
+;; (should (eq (key-binding "\C-aa") 'asdf))
+;; (with-temp-buffer
+;; (evil-local-mode 1)
+;; (evil-motion-state)
+;; (should (eq (key-binding "aa") 'asdf))))
+;; (setq bind-map-test-map-minor-child (make-sparse-keymap)
+;; bind-map-test-map-minor-child-prefix (make-sparse-keymap))
+;; (global-set-key "\C-a" nil)))
-(ert-deftest bind-map-test-major-mode-inheritance ()
- (with-temp-buffer
- (let ((tmpmap7 (make-sparse-keymap))
- (tmpmap8 (make-sparse-keymap))
- minor-mode-alist
- minor-mode-map-alist)
- (bind-map tmpmap7
- :keys ("C-a")
- :evil-keys ("a")
- :evil-states (normal))
- (bind-map-for-mode-inherit tmpmap8 tmpmap7
- :major-modes (emacs-lisp-mode))
- (define-key tmpmap8 "a" 'asdf)
- (evil-normalize-keymaps)
- (emacs-lisp-mode)
- (should (string= (key-binding "\C-aa") 'asdf))
- (evil-local-mode 1)
- (evil-motion-state)
- (should (string= (key-binding "aa") 'asdf)))))
+;; (ert-deftest bind-map-test-major-inheritance ()
+;; (let (minor-mode-map-alist)
+;; (bind-map bind-map-test-map-major-parent
+;; :keys ("C-a")
+;; :evil-keys ("a")
+;; :evil-states (motion))
+;; (bind-map-for-mode-inherit bind-map-test-map-major-child
+;; bind-map-test-map-major-parent
+;; :major-modes (emacs-lisp-mode))
+;; (define-key bind-map-test-map-major-child "a" 'asdf)
+;; (with-temp-buffer
+;; (evil-normalize-keymaps)
+;; (emacs-lisp-mode)
+;; (should (eq (key-binding "\C-aa") 'asdf))
+;; (evil-local-mode 1)
+;; (evil-motion-state)
+;; (should (eq (key-binding "aa") 'asdf)))
+;; (setq bind-map-test-map-major-child (make-sparse-keymap)
+;; bind-map-test-map-major-child-prefix (make-sparse-keymap))
+;; (global-set-key "\C-a" nil)))
- [nongnu] elpa/bind-map 76f742191b 24/97: Add gitignore, (continued)
- [nongnu] elpa/bind-map 76f742191b 24/97: Add gitignore, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 74e9defb60 25/97: Fix doctrings for recent additions, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 38dc69ab80 49/97: Make sure major-mode keys are activated initially, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map df2f5081e1 27/97: Use custom kbd command, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b30c22f7f9 33/97: Report symbol name in previously added error msg, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7ab7ae8dd3 62/97: Fix cask file, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 8e3df1f4cf 36/97: Use add-to-list for mm list and defvar prefix, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ce11d259bf 42/97: Update commentary to match README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 32a3361b3b 67/97: Bring back evil-define-minor-mode-key, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 56e4a914c2 82/97: Fix tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 797c2124f8 86/97: Restructure tests,
ELPA Syncer <=
- [nongnu] elpa/bind-map 6e1ba6edbd 94/97: Update README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 873c26d467 89/97: Get basic inheritance tests working, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6977e0fec5 96/97: Bump version to 1.1.2, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b59d7bbab7 40/97: Add note about dependence on evil to README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5c6f17939c 28/97: Get rid of eval-after-loads to fix evil bindings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 80c38c4052 61/97: Add badges, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4cccf8fb82 23/97: Add configuration var for default map suffix, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7a4d329a60 18/97: Correct wrong package names, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4cf9dfd1cb 81/97: Fix declare form, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ddce68ed1d 53/97: Move evil-local-mode hook next to var, ELPA Syncer, 2022/01/20