emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/with-simulated-input 5ce98adda7 022/134: Add test for SECS


From: ELPA Syncer
Subject: [nongnu] elpa/with-simulated-input 5ce98adda7 022/134: Add test for SECS = nil and for repeated idle simulations
Date: Mon, 10 Jan 2022 23:00:00 -0500 (EST)

branch: elpa/with-simulated-input
commit 5ce98adda7295d527c721409484fe59db3ef0c49
Author: Ryan C. Thompson <rct@thompsonclan.org>
Commit: Ryan C. Thompson <rct@thompsonclan.org>

    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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]