[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map 8d6b489feb 50/97: Add some basic tests
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map 8d6b489feb 50/97: Add some basic tests |
Date: |
Thu, 20 Jan 2022 07:59:19 -0500 (EST) |
branch: elpa/bind-map
commit 8d6b489feb3e7c07ad95e9dac383ddafad47abfa
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Add some basic tests
---
bind-map-tests.el | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/bind-map-tests.el b/bind-map-tests.el
new file mode 100644
index 0000000000..bcb806307c
--- /dev/null
+++ b/bind-map-tests.el
@@ -0,0 +1,51 @@
+;;; bind-map-tests.el
+
+;; Copyright (C) 2015 Justin Burkett
+
+;; Author: Justin Burkett <justin@burkett.cc>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+(require 'bind-map)
+(require 'evil)
+
+(ert-deftest bind-map-test-global-keys ()
+ "Test binding in global maps."
+ (let ((map (make-sparse-keymap)))
+ (bind-map map
+ :keys ("C-a")
+ :evil-keys ("a")
+ :evil-states (motion))
+ (define-key map "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")))))
+
+(ert-deftest bind-map-test-minor-mode-keys ()
+ "Test binding for minor-modes."
+ (let ((map (make-sparse-keymap))
+ (map-root-map (make-sparse-keymap))
+ (fake-minor-mode t)
+ minor-mode-map-alist)
+ (bind-map map
+ :minor-modes (fake-minor-mode)
+ :keys ("C-a")
+ :evil-keys ("a")
+ :evil-states (motion))
+ (define-key map "a" "b")
+ (should (string= (key-binding "\C-aa") "b"))
+ (should (keymapp (lookup-key (evil-get-auxiliary-keymap map-root-map
'motion) "a")))
+ (should (string= (lookup-key (evil-get-auxiliary-keymap map-root-map
'motion) "aa") "b"))))
- [nongnu] elpa/bind-map 8ec4516db2 48/97: Remove use of evil-define-key, (continued)
- [nongnu] elpa/bind-map 8ec4516db2 48/97: Remove use of evil-define-key, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map c182707793 41/97: Remove unnecessary helper functions and reorg, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b0b9e18947 66/97: Revert last commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f51d4b0c0d 79/97: Add bind-map-for-modes-derived, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 21b7ba7eca 30/97: Fix some docstrings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map cc1db8958c 64/97: Version 0.1, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 988f14eb77 65/97: Use evil-define-minor-mode-key for minor-mode keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 292794739c 71/97: Fix incorrect check of override mode in local hook, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b187069313 22/97: Add short versions for single major/minor mode, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d45971cd40 46/97: Use minor mode for overriding behavior, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 8d6b489feb 50/97: Add some basic tests,
ELPA Syncer <=
- [nongnu] elpa/bind-map 24d453a1e8 55/97: Call evil-normalize-maps for evil-keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b47b98455f 87/97: Simplify macro exp. for bind-mapfor-mode-inherit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 078c522f6e 93/97: Fix Makefile, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ffe5e63617 92/97: Version 1.1.0, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 46438e30c8 02/97: README formatting, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f835ed39fe 06/97: Minor changes, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 8dea8e8f91 10/97: Grammatical fix in README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map e5647f14cf 11/97: Clarify modes in README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map c8fa049b70 13/97: Update Commentary section to match README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 281a56c332 16/97: Fix major-mode-list, ELPA Syncer, 2022/01/20