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

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

[nongnu] elpa/subed 6d53418 224/389: Add test for killing non-last subti


From: ELPA Syncer
Subject: [nongnu] elpa/subed 6d53418 224/389: Add test for killing non-last subtitle
Date: Fri, 3 Dec 2021 11:00:30 -0500 (EST)

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

    Add test for killing non-last subtitle
---
 tests/test-subed-srt.el | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index 11107bb..6ac6664 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -929,20 +929,34 @@ Baz.
                                                 "2\n"
                                                 "00:02:02,234 --> 
00:02:10,345\n"
                                                 "Bar.\n"))))
-  (it "removes the previous subtitle when point is right above an ID."
-    (with-temp-buffer
-      (insert mock-srt-data)
-      (subed-jump-to-subtitle-id 3)
-      (backward-char)
-      (expect (looking-at "^\n3\n") :to-be t)
-      (subed-srt--subtitle-kill)
-      (expect (buffer-string) :to-equal (concat "1\n"
-                                                "00:01:01,000 --> 
00:01:05,123\n"
-                                                "Foo.\n"
-                                                "\n"
-                                                "3\n"
-                                                "00:03:03,45 --> 00:03:15,5\n"
-                                                "Baz.\n"))))
+  (describe "removes the previous subtitle when point is right above the ID"
+    (it "of the last subtitle."
+      (with-temp-buffer
+        (insert mock-srt-data)
+        (subed-jump-to-subtitle-id 3)
+        (backward-char)
+        (expect (looking-at "^\n3\n") :to-be t)
+        (subed-srt--subtitle-kill)
+        (expect (buffer-string) :to-equal (concat "1\n"
+                                                  "00:01:01,000 --> 
00:01:05,123\n"
+                                                  "Foo.\n\n"
+                                                  "3\n"
+                                                  "00:03:03,45 --> 
00:03:15,5\n"
+                                                  "Baz.\n"))))
+    (it "of a non-last subtitle."
+      (with-temp-buffer
+        (insert mock-srt-data)
+        (subed-jump-to-subtitle-id 2)
+        (backward-char)
+        (expect (looking-at "^\n2\n") :to-be t)
+        (subed-srt--subtitle-kill)
+        (expect (buffer-string) :to-equal (concat "2\n"
+                                                  "00:02:02,234 --> 
00:02:10,345\n"
+                                                  "Bar.\n\n"
+                                                  "3\n"
+                                                  "00:03:03,45 --> 
00:03:15,5\n"
+                                                  "Baz.\n"))))
+    )
   )
 
 (describe "Validating"



reply via email to

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