aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-dwim-shell-config-concat.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test-dwim-shell-config-concat.el b/tests/test-dwim-shell-config-concat.el
new file mode 100644
index 00000000..acbbbb2b
--- /dev/null
+++ b/tests/test-dwim-shell-config-concat.el
@@ -0,0 +1,29 @@
+;;; test-dwim-shell-config-concat.el --- Tests for concat filelist builder -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; Covers cj/dwim-shell--build-concat-filelist, which renders an ffmpeg
+;; concat-demuxer filelist from a list of paths. Building it in Elisp (rather
+;; than echo/tr/sed over <<*>>) keeps paths with spaces and quotes intact.
+
+;;; Code:
+
+(require 'ert)
+(require 'dwim-shell-config)
+
+(ert-deftest test-dwim-concat-filelist-plain-paths ()
+ "Normal: plain paths become single-quoted file lines, newline-separated."
+ (should (equal (cj/dwim-shell--build-concat-filelist '("/v/a.mp4" "/v/b.mp4"))
+ "file '/v/a.mp4'\nfile '/v/b.mp4'")))
+
+(ert-deftest test-dwim-concat-filelist-space-in-path ()
+ "Boundary: a path with spaces stays inside the quotes, unsplit."
+ (should (equal (cj/dwim-shell--build-concat-filelist '("/v/my movie.mp4"))
+ "file '/v/my movie.mp4'")))
+
+(ert-deftest test-dwim-concat-filelist-quote-in-path ()
+ "Error/edge: a single quote in a path is escaped for the concat list."
+ (should (equal (cj/dwim-shell--build-concat-filelist '("/v/it's here.mp4"))
+ "file '/v/it'\\''s here.mp4'")))
+
+(provide 'test-dwim-shell-config-concat)
+;;; test-dwim-shell-config-concat.el ends here