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

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

[nongnu] elpa/subed d98325c 011/389: Add tests for getting subtitle star


From: ELPA Syncer
Subject: [nongnu] elpa/subed d98325c 011/389: Add tests for getting subtitle start/stop time
Date: Fri, 3 Dec 2021 10:59:47 -0500 (EST)

branch: elpa/subed
commit d98325c7943e86983e835e5f1099c0c9635bf09c
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>

    Add tests for getting subtitle start/stop time
---
 tests/test-subed-srt.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index 7f57ba8..d6b84ef 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -90,6 +90,18 @@ Baz.
                                                 (subed-srt-move-to-subtitle-id 
outset-id)
                                                 (expect 
(subed-srt--subtitle-id-at-msecs msecs) :to-equal target-id)))))))
                     )
+          (describe "the subtitle start/stop time"
+                    (it "returns the time in milliseconds."
+                        (with-temp-buffer
+                          (insert mock-srt-data)
+                          (subed-srt-move-to-subtitle-text 2)
+                          (expect (subed-srt--subtitle-msecs-start) :to-equal 
(+ (* 2 60000) (* 2 1000) 234))
+                          (expect (subed-srt--subtitle-msecs-stop) :to-equal 
(+ (* 2 60000) (* 10 1000) 345))))
+                    (it "returns nil if time can't be found."
+                        (with-temp-buffer
+                          (expect (subed-srt--subtitle-msecs-start) :to-be nil)
+                          (expect (subed-srt--subtitle-msecs-stop) :to-be 
nil)))
+                    )
           )
 
 



reply via email to

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