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

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

[nongnu] elpa/pacmacs d608708f15 311/472: UT for handle-ghost-blinking-t


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs d608708f15 311/472: UT for handle-ghost-blinking-threshold (#159)
Date: Thu, 6 Jan 2022 21:59:34 -0500 (EST)

branch: elpa/pacmacs
commit d608708f154fbcbd4a36b390893f1acb628bce82
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    UT for handle-ghost-blinking-threshold (#159)
---
 test/pacmacs-test.el | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/test/pacmacs-test.el b/test/pacmacs-test.el
index 2575314fe9..f2be579b06 100644
--- a/test/pacmacs-test.el
+++ b/test/pacmacs-test.el
@@ -90,3 +90,19 @@
     (should (equal '((:row 30 :column 40)
                      (:row 10 :column 20))
                    destroyed-objects))))
+
+(ert-deftest pacmacs--handle-ghost-blinking-threshold-test ()
+  (let ((pacmacs--terrified-ghosts '((:terrified-timer 900 :current-animation 
1)
+                                     (:terrified-timer 999 :current-animation 
2)
+                                     (:terrified-timer 1001 :current-animation 
3)
+                                     (:terrified-timer 899 :current-animation 
4)))
+        (pacmacs-tick-duration-ms 100)
+        (pacmacs--ghost-blinking-threshold-ms 1000))
+    (with-mock
+     (mock (pacmacs-load-anim "Blinking-Terrified-Ghost") => 42 :times 2)
+     (pacmacs--handle-ghost-blinking-threshold)
+     (should (equal '((:terrified-timer 900 :current-animation 42)
+                      (:terrified-timer 999 :current-animation 42)
+                      (:terrified-timer 1001 :current-animation 3)
+                      (:terrified-timer 899 :current-animation 4))
+                    pacmacs--terrified-ghosts)))))



reply via email to

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