[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/which-key 2537514: Don't require evil in which-key-test
From: |
ELPA Syncer |
Subject: |
[elpa] externals/which-key 2537514: Don't require evil in which-key-tests.el |
Date: |
Tue, 6 Jul 2021 10:57:26 -0400 (EDT) |
branch: externals/which-key
commit 253751458e66f44a6e7deac83a47eabf3958f064
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Don't require evil in which-key-tests.el
Patch from Stefan Monnier
---
.gitignore | 5 +++++
which-key-tests.el | 45 ++++++++++++++++++++++++---------------------
2 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/.gitignore b/.gitignore
index de0966b..5998b43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,10 @@
*~
*.elc
+
+# Autogenerated by GNU ELPA scripts
+/which-key-autoloads.el
+/which-key-pkg.el
+
# Used to setup library paths for emacs -Q
private-test-setup.el
/.cask/
diff --git a/which-key-tests.el b/which-key-tests.el
index 877f009..cce75ce 100644
--- a/which-key-tests.el
+++ b/which-key-tests.el
@@ -1,6 +1,6 @@
;;; which-key-tests.el --- Tests for which-key.el -*- lexical-binding: t; -*-
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
;; Author: Justin Burkett <justin@burkett.cc>
;; Maintainer: Justin Burkett <justin@burkett.cc>
@@ -26,12 +26,11 @@
(require 'which-key)
(require 'ert)
-(require 'evil)
(ert-deftest which-key-test--keymap-based-bindings ()
(let ((map (make-sparse-keymap))
(prefix-map (make-sparse-keymap)))
- (define-key prefix-map "x" 'ignore)
+ (define-key prefix-map "x" #'ignore)
(define-key map "\C-a" 'complete)
(define-key map "\C-b" prefix-map)
(which-key-add-keymap-based-replacements map
@@ -68,8 +67,8 @@
(let ((which-key-replacement-alist
'((("C-c [a-d]" . nil) . ("C-c a" . "c-c a"))
(("C-c .+" . nil) . ("C-c *" . "c-c *"))))
- (test-mode-1 t)
- (test-mode-2 nil)
+ (test-mode-1 't)
+ (test-mode-2 'nil)
which-key-allow-multiple-replacements)
(which-key-add-key-based-replacements
"C-c ." "test ."
@@ -141,12 +140,16 @@
(should (equal (which-key--extract-key "M-a a .. c") "a .. c")))
(ert-deftest which-key-test--get-keymap-bindings ()
+ (skip-unless (require 'evil nil t))
+ (defvar evil-local-mode)
+ (defvar evil-state)
+ (declare-function evil-define-key* "ext:evil")
(let ((map (make-sparse-keymap))
(evil-local-mode t)
(evil-state 'normal)
which-key-replacement-alist)
(define-key map [which-key-a] '(which-key "blah"))
- (define-key map "b" 'ignore)
+ (define-key map "b" #'ignore)
(define-key map "c" "c")
(define-key map "dd" "dd")
(define-key map "eee" "eee")
@@ -198,58 +201,58 @@
(let ((which-key-sort-uppercase-first t))
(should
(equal
- (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order))
+ (mapcar #'car (sort (copy-sequence keys) #'which-key-key-order))
'("SPC" "A" "B" "a" "b" "p" "C-a"))))
(let (which-key-sort-uppercase-first)
(should
(equal
- (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order))
+ (mapcar #'car (sort (copy-sequence keys) #'which-key-key-order))
'("SPC" "a" "b" "p" "A" "B" "C-a"))))
(let ((which-key-sort-uppercase-first t))
(should
(equal
- (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha))
+ (mapcar #'car (sort (copy-sequence keys) #'which-key-key-order-alpha))
'("SPC" "A" "a" "B" "b" "p" "C-a"))))
(let (which-key-sort-uppercase-first)
(should
(equal
- (mapcar 'car (sort (copy-sequence keys) 'which-key-key-order-alpha))
+ (mapcar #'car (sort (copy-sequence keys) #'which-key-key-order-alpha))
'("SPC" "a" "A" "b" "B" "p" "C-a"))))
(let ((which-key-sort-uppercase-first t))
(should
(equal
- (mapcar 'car (sort (copy-sequence keys)
- 'which-key-prefix-then-key-order))
+ (mapcar #'car (sort (copy-sequence keys)
+ #'which-key-prefix-then-key-order))
'("SPC" "A" "B" "a" "b" "C-a" "p"))))
(let (which-key-sort-uppercase-first)
(should
(equal
- (mapcar 'car (sort (copy-sequence keys)
- 'which-key-prefix-then-key-order))
+ (mapcar #'car (sort (copy-sequence keys)
+ #'which-key-prefix-then-key-order))
'("SPC" "a" "b" "A" "B" "C-a" "p"))))
(let ((which-key-sort-uppercase-first t))
(should
(equal
(mapcar 'car (sort (copy-sequence keys)
- 'which-key-prefix-then-key-order-reverse))
+ #'which-key-prefix-then-key-order-reverse))
'("p" "SPC" "A" "B" "a" "b" "C-a"))))
(let (which-key-sort-uppercase-first)
(should
(equal
- (mapcar 'car (sort (copy-sequence keys)
- 'which-key-prefix-then-key-order-reverse))
+ (mapcar #'car (sort (copy-sequence keys)
+ #'which-key-prefix-then-key-order-reverse))
'("p" "SPC" "a" "b" "A" "B" "C-a"))))
(let ((which-key-sort-uppercase-first t))
(should
(equal
- (mapcar 'car (sort (copy-sequence keys)
- 'which-key-description-order))
+ (mapcar #'car (sort (copy-sequence keys)
+ #'which-key-description-order))
'("p" "C-a" "SPC" "b" "B" "a" "A"))))
(let (which-key-sort-uppercase-first)
(should
(equal
- (mapcar 'car (sort (copy-sequence keys)
- 'which-key-description-order))
+ (mapcar #'car (sort (copy-sequence keys)
+ #'which-key-description-order))
'("p" "C-a" "SPC" "b" "B" "a" "A"))))))
(provide 'which-key-tests)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/which-key 2537514: Don't require evil in which-key-tests.el,
ELPA Syncer <=