emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/bind-map 873c26d467 89/97: Get basic inheritance tests wor


From: ELPA Syncer
Subject: [nongnu] elpa/bind-map 873c26d467 89/97: Get basic inheritance tests working
Date: Thu, 20 Jan 2022 07:59:30 -0500 (EST)

branch: elpa/bind-map
commit 873c26d467d6077857f78332c59c54d5d66a641d
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>

    Get basic inheritance tests working
---
 bind-map-tests.el | 88 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 45 insertions(+), 43 deletions(-)

diff --git a/bind-map-tests.el b/bind-map-tests.el
index d9e05a54c8..2653c0c99a 100644
--- a/bind-map-tests.el
+++ b/bind-map-tests.el
@@ -97,47 +97,49 @@
                               bind-map-major-modes-alist))
                    '(mm1 mm2 mm3 mm4 mm5 mm6)))))
 
-;; (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-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))
+    ;; FIXME: 
+    (eval
+     '(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" "e")
+    (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 (string= (key-binding "\C-aa") "e"))
+      (evil-local-mode 1)
+      (evil-motion-state)
+      (should (string= (key-binding "aa") "e")))
+    (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-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)))
+(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))
+    ;; FIXME: 
+    (eval 
+     '(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" "f")
+    (evil-normalize-keymaps)
+    (emacs-lisp-mode)
+    (should (string= (key-binding "\C-aa") "f"))
+    (evil-local-mode 1)
+    (evil-motion-state)
+    (should (string= (key-binding "aa") "f"))
+    (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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]