[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/subed 86914b4 053/389: Add more tests for moving to next/p
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/subed 86914b4 053/389: Add more tests for moving to next/previous subtitle ID |
Date: |
Fri, 3 Dec 2021 10:59:55 -0500 (EST) |
branch: elpa/subed
commit 86914b4b87b45b63538a75f80963925d59d761e6
Author: Random User <rndusr@posteo.de>
Commit: Random User <rndusr@posteo.de>
Add more tests for moving to next/previous subtitle ID
---
tests/test-subed-srt.el | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index 5d9b02f..044054e 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -374,17 +374,40 @@ Baz.
(it "returns point when there is a next subtitle."
(with-temp-buffer
(insert mock-srt-data)
- (subed-srt-move-to-subtitle-id 2)
+ (subed-srt-move-to-subtitle-id 1)
+ (expect (thing-at-point 'word) :to-equal "1")
+ (expect (subed-srt-forward-subtitle-id) :to-be 39)
(expect (thing-at-point 'word) :to-equal "2")
+ (subed-srt-move-to-subtitle-time-start 2)
+ (expect (thing-at-point 'word) :to-equal "00")
(expect (subed-srt-forward-subtitle-id) :to-be 77)
(expect (thing-at-point 'word) :to-equal "3")))
(it "returns nil and doesn't move when there is no next
subtitle."
(with-temp-buffer
- (insert (concat mock-srt-data "\n\n"))
+ (expect (thing-at-point 'word) :to-equal nil)
+ (expect (subed-srt-forward-subtitle-id) :to-be nil))
+ (with-temp-buffer
+ (insert (concat mock-srt-data))
+ (subed-srt-move-to-subtitle-text 1)
+ (expect (thing-at-point 'word) :to-equal "Foo")
+ (expect (subed-srt-forward-subtitle-id) :to-be 39)
+ (expect (thing-at-point 'word) :to-equal "2")
+ (subed-srt-move-to-subtitle-time-stop 2)
+ (expect (thing-at-point 'word) :to-equal "00")
+ (expect (subed-srt-forward-subtitle-id) :to-be 77)
+ (expect (thing-at-point 'word) :to-equal "3"))
+ (with-temp-buffer
+ (insert (concat mock-srt-data))
(subed-srt-move-to-subtitle-text 3)
(expect (thing-at-point 'word) :to-equal "Baz")
(expect (subed-srt-forward-subtitle-id) :to-be nil)
- (expect (thing-at-point 'word) :to-equal "Baz")))
+ (expect (thing-at-point 'word) :to-equal "Baz"))
+ (with-temp-buffer
+ (insert (concat mock-srt-data "\n\n"))
+ (subed-srt-move-to-subtitle-time-stop 3)
+ (expect (thing-at-point 'word) :to-equal "00")
+ (expect (subed-srt-forward-subtitle-id) :to-be nil)
+ (expect (thing-at-point 'word) :to-equal "00")))
)
(describe "to previous subtitle ID"
(it "returns point when there is a previous subtitle."
@@ -412,7 +435,13 @@ Baz.
(subed-srt-move-to-subtitle-text 1)
(expect (thing-at-point 'word) :to-equal "Foo")
(expect (subed-srt-backward-subtitle-id) :to-be nil)
- (expect (thing-at-point 'word) :to-equal "Foo")))
+ (expect (thing-at-point 'word) :to-equal "Foo"))
+ (with-temp-buffer
+ (insert (concat "\n\n\n" mock-srt-data))
+ (subed-srt-move-to-subtitle-time-stop 1)
+ (expect (thing-at-point 'word) :to-equal "00")
+ (expect (subed-srt-backward-subtitle-id) :to-be nil)
+ (expect (thing-at-point 'word) :to-equal "00")))
)
(describe "to next subtitle text"
(it "returns point when there is a next subtitle."
- [nongnu] elpa/subed 005c0cc 027/389: Remove TODO for C-u N M-k, (continued)
- [nongnu] elpa/subed 005c0cc 027/389: Remove TODO for C-u N M-k, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed fd737b7 035/389: Use save-excursion in subed--save-excursion, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0815e10 047/389: Simplify subed-srt--regexp-duration, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed bbd239a 042/389: subed-srt--regenerate-ids: Wrap function body in atomic-change-group, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8790abf 048/389: Add subed-srt-validate, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 7d76a35 049/389: Simplify subed-srt-move-to-subtitle-text, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 821b259 045/389: subed-srt--regenerate-ids: Make this a public function, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed d3d2013 050/389: Look for stop time only on the relevant line, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 042941c 051/389: Fix docstrings, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4e50796 052/389: Fix subed-srt-backward-subtitle-id, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 86914b4 053/389: Add more tests for moving to next/previous subtitle ID,
ELPA Syncer <=
- [nongnu] elpa/subed 6391996 056/389: Kill debugging buffer+window in subed-disable-debugging, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 0fe0c82 059/389: When opening debug window, always split horizontally, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 4e31010 062/389: mpv returns nil as "time-pos" in at least one circumstance, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 1c8e0d1 064/389: Sanitize separator between start and stop time, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 3c1a1b4 065/389: Don't validate anything if buffer is empty, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed ce14b0d 074/389: Adjust comment, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 8fa0f6c 078/389: Remove debugging messages, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 96e7fcf 086/389: Add subed--get-seconds-move, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 189e5aa 088/389: Make more functions available format-agnosticly, ELPA Syncer, 2021/12/03
- [nongnu] elpa/subed 14d52d7 089/389: Add subed--for-each-subtitle, ELPA Syncer, 2021/12/03