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

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

[nongnu] elpa/subed c895b91 012/389: Add test for sanitizing on empty su


From: ELPA Syncer
Subject: [nongnu] elpa/subed c895b91 012/389: Add test for sanitizing on empty subtitle texts
Date: Fri, 3 Dec 2021 10:59:47 -0500 (EST)

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

    Add test for sanitizing on empty subtitle texts
---
 tests/test-subed-srt.el | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index d6b84ef..2e26458 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -488,14 +488,22 @@ Baz.
                          "3\n"
                          "00:12:01,000 --> 00:01:05,123\n"
                          "Foo.\n"))))
-          (it "preserves point in the current subtitle."
-              (with-temp-buffer
-                (insert mock-srt-data)
-                (goto-char (point-min))
-                (re-search-forward "01:01")
-                (replace-match "12:01")
-                (search-forward "\n")
-                (expect (current-word) :to-equal "Foo")
-                (subed-srt-sort)
-                (expect (current-word) :to-equal "Foo")))
+          (describe "preserves point in the current subtitle"
+                    (it "when subtitle text is non-empty."
+                        (with-temp-buffer
+                          (insert mock-srt-data)
+                          (goto-char (point-min))
+                          (re-search-forward "01:01")
+                          (replace-match "12:01")
+                          (search-forward "\n")
+                          (expect (current-word) :to-equal "Foo")
+                          (subed-srt-sort)
+                          (expect (current-word) :to-equal "Foo")))
+                    (it "when subtitle text is empty."
+                        (with-temp-buffer
+                          (insert "1\n00:12:01,000 --> 00:01:05,123\n")
+                          (goto-char (point-max))
+                          (subed-srt-sort)
+                          (expect (point) :to-equal 33)))
+                    )
           )



reply via email to

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