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

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

[nongnu] elpa/subed e9f3e4e 215/389: Move tests for killing SRT subtitle


From: ELPA Syncer
Subject: [nongnu] elpa/subed e9f3e4e 215/389: Move tests for killing SRT subtitles to test-subed-srt.el
Date: Fri, 3 Dec 2021 11:00:29 -0500 (EST)

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

    Move tests for killing SRT subtitles to test-subed-srt.el
---
 tests/test-subed-srt.el | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/test-subed.el     | 53 -------------------------------------------------
 2 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/tests/test-subed-srt.el b/tests/test-subed-srt.el
index b19df2d..a914daa 100644
--- a/tests/test-subed-srt.el
+++ b/tests/test-subed-srt.el
@@ -895,6 +895,59 @@ Baz.
       (expect #'subed-srt--regenerate-ids :not :to-have-been-called)))
   )
 
+(describe "Killing a subtitle"
+  (it "removes it when it is the first one."
+    (with-temp-buffer
+      (insert mock-srt-data)
+      (subed-srt--jump-to-subtitle-text 1)
+      (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"))))
+  (it "removes it when it is in the middle."
+    (with-temp-buffer
+      (insert mock-srt-data)
+      (subed-srt--jump-to-subtitle-text 2)
+      (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 "removes it when it is the last one."
+    (with-temp-buffer
+      (insert mock-srt-data)
+      (subed-srt--jump-to-subtitle-text 3)
+      (subed-srt--subtitle-kill)
+      (expect (buffer-string) :to-equal (concat "1\n"
+                                                "00:01:01,000 --> 
00:01:05,123\n"
+                                                "Foo.\n"
+                                                "\n"
+                                                "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 "Validating"
   (it "works in empty buffer."
     (with-temp-buffer
diff --git a/tests/test-subed.el b/tests/test-subed.el
index 10e8ca3..de966f9 100644
--- a/tests/test-subed.el
+++ b/tests/test-subed.el
@@ -353,59 +353,6 @@
       (expect (buffer-string) :to-equal "foo")))
   )
 
-(describe "Killing a subtitle"
-  (it "removes it when it is the first one."
-    (with-temp-buffer
-      (insert mock-srt-data)
-      (subed-srt--jump-to-subtitle-text 1)
-      (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"))))
-  (it "removes it when it is in the middle."
-    (with-temp-buffer
-      (insert mock-srt-data)
-      (subed-srt--jump-to-subtitle-text 2)
-      (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 "removes it when it is the last one."
-    (with-temp-buffer
-      (insert mock-srt-data)
-      (subed-srt--jump-to-subtitle-text 3)
-      (subed-srt--subtitle-kill)
-      (expect (buffer-string) :to-equal (concat "1\n"
-                                                "00:01:01,000 --> 
00:01:05,123\n"
-                                                "Foo.\n"
-                                                "\n"
-                                                "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 "Moving"
   (it "adjusts start and stop time by the same amount."
     (with-temp-buffer



reply via email to

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