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

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

[nongnu] elpa/subed ac4bc87 025/389: Add more tests for moving to subtit


From: ELPA Syncer
Subject: [nongnu] elpa/subed ac4bc87 025/389: Add more tests for moving to subtitle ID
Date: Fri, 3 Dec 2021 10:59:50 -0500 (EST)

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

    Add more tests for moving to subtitle ID
---
 tests/test-subed-srt.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index 702cbaa..1ed18d3 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -163,6 +163,21 @@ Baz.
                         (with-temp-buffer
                           (expect (buffer-string) :to-equal "")
                           (expect (subed-srt-move-to-subtitle-id) :to-equal 
nil)))
+                    (it "returns ID's point when buffer starts with blank 
lines."
+                        (with-temp-buffer
+                          (insert (concat " \n \t \n" mock-srt-data))
+                          (search-backward "Foo.")
+                          (expect (thing-at-point 'line) :to-equal "Foo.\n")
+                          (expect (subed-srt-move-to-subtitle-id) :to-equal 7)
+                          (expect (thing-at-point 'word) :to-equal "1")))
+                    (it "returns ID's point when subtitles are separated with 
blank lines."
+                        (with-temp-buffer
+                          (insert mock-srt-data)
+                          (goto-char (point-min))
+                          (search-forward "Foo.\n")
+                          (insert " \n \t \n")
+                          (expect (subed-srt-move-to-subtitle-id) :to-equal 1)
+                          (expect (thing-at-point 'word) :to-equal "1")))
                     )
           (describe "to specific subtitle ID"
                     (it "returns ID's point if wanted ID exists."



reply via email to

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