summaryrefslogtreecommitdiff
path: root/tests/test-video-audio-recording--parse-pactl-sources-verbose.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-video-audio-recording--parse-pactl-sources-verbose.el')
-rw-r--r--tests/test-video-audio-recording--parse-pactl-sources-verbose.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test-video-audio-recording--parse-pactl-sources-verbose.el b/tests/test-video-audio-recording--parse-pactl-sources-verbose.el
index e856f29a..67945846 100644
--- a/tests/test-video-audio-recording--parse-pactl-sources-verbose.el
+++ b/tests/test-video-audio-recording--parse-pactl-sources-verbose.el
@@ -1,7 +1,7 @@
;;; test-video-audio-recording--parse-pactl-sources-verbose.el --- Tests for verbose pactl parser -*- lexical-binding: t; -*-
;;; Commentary:
-;; Unit tests for cj/recording--parse-pactl-sources-verbose.
+;; Unit tests for cj/recording--parse-pactl-verbose.
;; Parses the verbose output of `pactl list sources' into structured tuples
;; of (name description mute state).
@@ -20,7 +20,7 @@
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-normal-single-source ()
"Test parsing a single source entry."
(let* ((output "Source #65\n\tState: SUSPENDED\n\tName: alsa_input.usb-Jabra-00.mono\n\tDescription: Jabra SPEAK 510 Mono\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (= 1 (length result)))
(should (equal "alsa_input.usb-Jabra-00.mono" (nth 0 (car result))))
(should (equal "Jabra SPEAK 510 Mono" (nth 1 (car result))))
@@ -31,7 +31,7 @@
"Test parsing multiple source entries."
(let* ((output (concat "Source #65\n\tState: SUSPENDED\n\tName: device-a\n\tDescription: Device A\n\tMute: no\n"
"Source #66\n\tState: RUNNING\n\tName: device-b\n\tDescription: Device B\n\tMute: yes\n"))
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (= 2 (length result)))
(should (equal "device-a" (nth 0 (car result))))
(should (equal "Device B" (nth 1 (cadr result))))
@@ -40,7 +40,7 @@
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-normal-monitors-included ()
"Test that monitor sources are parsed (filtering is done by caller)."
(let* ((output "Source #67\n\tState: SUSPENDED\n\tName: alsa_output.jds.monitor\n\tDescription: Monitor of JDS Labs\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (= 1 (length result)))
(should (string-match-p "\\.monitor$" (nth 0 (car result))))))
@@ -48,7 +48,7 @@
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-boundary-empty-input ()
"Test that empty input returns empty list."
- (should (null (cj/recording--parse-pactl-sources-verbose ""))))
+ (should (null (cj/recording--parse-pactl-verbose "" "Source"))))
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-boundary-extra-fields ()
"Test that extra fields between sources are ignored."
@@ -56,7 +56,7 @@
"\tDriver: PipeWire\n\tSample Specification: s16le 2ch 48000Hz\n"
"\tChannel Map: front-left,front-right\n"
"Source #66\n\tState: SUSPENDED\n\tName: dev-b\n\tDescription: Dev B\n\tMute: no\n"))
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (= 2 (length result)))
(should (equal "dev-a" (nth 0 (car result))))
(should (equal "dev-b" (nth 0 (cadr result))))))
@@ -64,7 +64,7 @@
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-boundary-description-with-parens ()
"Test descriptions containing parentheses are captured fully."
(let* ((output "Source #91\n\tState: SUSPENDED\n\tName: hdmi.monitor\n\tDescription: Monitor of Radeon (HDMI 2)\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (equal "Monitor of Radeon (HDMI 2)" (nth 1 (car result))))))
;;; Error Cases
@@ -72,7 +72,7 @@
(ert-deftest test-video-audio-recording--parse-pactl-sources-verbose-error-malformed-no-name ()
"Test that source entries without Name field are skipped."
(let* ((output "Source #65\n\tState: SUSPENDED\n\tDescription: Orphan\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sources-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Source")))
(should (null result))))
(provide 'test-video-audio-recording--parse-pactl-sources-verbose)