branch: elpa/with-simulated-input
commit 582844da4c5b0a1d56f269bb9286947b752c6cb6
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>
Add a failing test for byte-compiled closures
See #6.
---
tests/test-with-simulated-input.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tests/test-with-simulated-input.el
b/tests/test-with-simulated-input.el
index db1c465f5a..a8bbdf8ded 100644
--- a/tests/test-with-simulated-input.el
+++ b/tests/test-with-simulated-input.el
@@ -11,6 +11,11 @@
(defvar my-collection)
(defvar my-non-lexical-var)
+(defun call-wsi-from-bytecomp-fun ()
+ (with-simulated-input "hello SPC world RET"
+ (read-string "Say hello: ")))
+(byte-compile 'call-wsi-from-bytecomp-fun)
+
(describe "`wsi-get-unbound-key'"
(it "should find an unbound key"
(let ((unbound-key (wsi-get-unbound-key)))
@@ -75,6 +80,10 @@
(expect (current-buffer) :to-equal temp-buffer)
(expect (current-buffer) :not :to-equal orig-current-buffer)))))
+ (it "should work in byte-compiled code (issue #6)"
+ (expect (call-wsi-from-bytecomp-fun)
+ :not :to-throw))
+
(describe "used with `completing-read'"
:var (completing-read-function)