branch: elpa/with-simulated-input
commit 5ce98adda7295d527c721409484fe59db3ef0c49
Author: Ryan C. Thompson <[email protected]>
Commit: Ryan C. Thompson <[email protected]>
Add test for SECS = nil and for repeated idle simulations
---
tests/test-with-simulated-input.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/test-with-simulated-input.el
b/tests/test-with-simulated-input.el
index f533759a8b..aaef8fee5a 100644
--- a/tests/test-with-simulated-input.el
+++ b/tests/test-with-simulated-input.el
@@ -109,9 +109,11 @@
(run-with-idle-timer 500 nil 'idle-canary)
(wsi-simulate-idle-time 500)
(expect 'idle-canary :to-have-been-called))
- (it "should not run idle times with longer times"
+ (it "should not run idle timers with longer times even when called multiple
times"
(run-with-idle-timer 500 nil 'set 'idle-canary)
- (wsi-simulate-idle-time 100)
+ (wsi-simulate-idle-time 400)
+ (wsi-simulate-idle-time 400)
+ (wsi-simulate-idle-time 400)
(expect 'idle-canary :not :to-have-been-called))
(it "should run idle timers added by other idle timers"
(run-with-idle-timer
@@ -125,6 +127,12 @@
50 nil 'idle-canary)
(wsi-simulate-idle-time 500)
(expect 'idle-canary :to-have-been-called))
+ (it "should run all idle timers when called with SECS = nil"
+ (run-with-idle-timer 1000 nil 'idle-canary)
+ (wsi-simulate-idle-time 1)
+ (expect 'idle-canary :not :to-have-been-called)
+ (wsi-simulate-idle-time)
+ (expect 'idle-canary :to-have-been-called))
(describe "used within `with-simulated-input'"
(it "should allow idle timers to trigger during simulated input"