[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/with-simulated-input 1006e93000 125/134: Add more tests to
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/with-simulated-input 1006e93000 125/134: Add more tests to improve coverage |
Date: |
Mon, 10 Jan 2022 23:00:13 -0500 (EST) |
branch: elpa/with-simulated-input
commit 1006e930002aef4635c473dda16905c1e336ff64
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>
Add more tests to improve coverage
---
tests/test-with-simulated-input.el | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/tests/test-with-simulated-input.el
b/tests/test-with-simulated-input.el
index 8d25db21bd..8675c9a686 100644
--- a/tests/test-with-simulated-input.el
+++ b/tests/test-with-simulated-input.el
@@ -28,7 +28,23 @@ from byte-compiled code."
(expect
(let ((wsi-last-used-next-action-bind nil))
(wsi-get-unbound-key "" '("abc" "123")))
- :to-throw 'error)))
+ :to-throw 'error))
+ (it "should find a new key when its previously chosen key becomes bound"
+ (let ((overriding-terminal-local-map (make-sparse-keymap))
+ (previous-key (wsi-get-unbound-key)))
+ (define-key overriding-terminal-local-map
+ (kbd previous-key) #'ignore)
+ ;; Claim another few unbound keys as well, just for good
+ ;; measure.
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (expect
+ (wsi-get-unbound-key)
+ :not :to-equal previous-key))))
(defmacro progn-at-runtime (&rest body)
"Like `progn', but evaluate BODY entirely at runtime.
@@ -434,8 +450,27 @@ during macro expansion will be caught as well."
:to-be t))
(expect-warning
(expect (with-simulated-input "Is SPC anybody SPC listening? RET" 1 2 3)
+ :to-equal 3))
+ (expect-warning
+ (expect (let ((x (+ 1 2)))
+ (with-simulated-input "Is SPC anybody SPC listening? RET" x))
:to-equal 3)))
+ (it "should work when `overriding-terminal-local-map' is bound"
+ (let ((overriding-terminal-local-map (make-sparse-keymap)))
+ ;; Claim the first few unbound keys to force
+ ;; `with-simulated-input' to find a new one.
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (define-key overriding-terminal-local-map
+ (kbd (wsi-get-unbound-key)) #'ignore)
+ (expect
+ (with-simulated-input "hello RET"
+ (read-string "Enter a string: "))
+ :to-equal "hello")))
+
(describe "used with `completing-read'"
:var (completing-read-function)
- [nongnu] branch elpa/with-simulated-input created (now 0f43fe46d4), ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 568bfb8e1d 015/134: Version 2.0, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 5bdbde591d 058/134: Eliminate spurious warning in test file, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 433ee087ce 066/134: Test: handle `undercover' not being installed, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ea6735cf1b 083/134: KEYS: support a single variable, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input d32cbc3ac9 093/134: Revert "Remove interpolation test", ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 39dbadff0b 120/134: Update the README to reflect current supported syntax, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input e7a7a6c39d 109/134: Don't use "define-advice" in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 334f9f244f 119/134: Implement support for characters in KEYS, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 00209c2be3 128/134: Test on 27.2 instead of 27.1, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 1006e93000 125/134: Add more tests to improve coverage,
ELPA Syncer <=
- [nongnu] elpa/with-simulated-input 9c160b2d81 106/134: Add warnings for quoted list KEYS and nil/constant BODY, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 4eedb0eee8 126/134: Use an alternate method to disable eager macro-expansion for testing, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9d082a372a 113/134: Be more selective about which file changes trigger a CI run, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 681397b90d 130/134: Also test variables containing characters, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 9ecf7c3f84 107/134: Improve code for detecting warnings in tests, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input ddd7bd71b1 011/134: Add "wsi-simulate-idle-time" and tests for it, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 662055c0a5 029/134: Handle non-lexical contexts as well as lexical, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 7f37451dcf 019/134: Use closures instead of quoted expressions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input e7e8829eee 020/134: Make SECS arg to wsi-simulated-idle-time optional, ELPA Syncer, 2022/01/10
- [nongnu] elpa/with-simulated-input 47aa40dbe1 021/134: Handle the case where SECS exactly equals a timer's time, ELPA Syncer, 2022/01/10