summaryrefslogtreecommitdiff
path: root/tests/test-video-audio-recording--parse-pactl-sinks-verbose.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-video-audio-recording--parse-pactl-sinks-verbose.el')
-rw-r--r--tests/test-video-audio-recording--parse-pactl-sinks-verbose.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test-video-audio-recording--parse-pactl-sinks-verbose.el b/tests/test-video-audio-recording--parse-pactl-sinks-verbose.el
index 8a2cba2d..59159039 100644
--- a/tests/test-video-audio-recording--parse-pactl-sinks-verbose.el
+++ b/tests/test-video-audio-recording--parse-pactl-sinks-verbose.el
@@ -1,7 +1,7 @@
;;; test-video-audio-recording--parse-pactl-sinks-verbose.el --- Tests for verbose pactl sinks parser -*- lexical-binding: t; -*-
;;; Commentary:
-;; Unit tests for cj/recording--parse-pactl-sinks-verbose.
+;; Unit tests for cj/recording--parse-pactl-verbose.
;; Parses the verbose output of `pactl list sinks' into structured tuples
;; of (name description mute state).
@@ -34,7 +34,7 @@
(ert-deftest test-parse-pactl-sinks-verbose-normal-multiple-sinks ()
"Test parsing multiple sink entries from fixture."
(let* ((output (test-sinks--fixture "pactl-sinks-verbose-normal.txt"))
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (= 3 (length result)))
(should (equal "alsa_output.usb-JDS_Labs-00.analog-stereo" (nth 0 (nth 0 result))))
(should (equal "JDS Labs Element IV Analog Stereo" (nth 1 (nth 0 result))))
@@ -44,7 +44,7 @@
(ert-deftest test-parse-pactl-sinks-verbose-normal-single-sink ()
"Test parsing a single sink entry."
(let* ((output "Sink #65\n\tState: SUSPENDED\n\tName: alsa_output.usb-JDS-00.analog-stereo\n\tDescription: JDS Labs Element IV\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (= 1 (length result)))
(should (equal "alsa_output.usb-JDS-00.analog-stereo" (nth 0 (car result))))
(should (equal "JDS Labs Element IV" (nth 1 (car result))))
@@ -54,7 +54,7 @@
(ert-deftest test-parse-pactl-sinks-verbose-normal-muted-sink ()
"Test that muted sinks are parsed (filtering is done by caller)."
(let* ((output (test-sinks--fixture "pactl-sinks-verbose-muted.txt"))
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (= 3 (length result)))
;; Second sink is muted
(should (equal "yes" (nth 2 (nth 1 result))))))
@@ -63,14 +63,14 @@
(ert-deftest test-parse-pactl-sinks-verbose-boundary-empty-input ()
"Test that empty input returns empty list."
- (should (null (cj/recording--parse-pactl-sinks-verbose ""))))
+ (should (null (cj/recording--parse-pactl-verbose "" "Sink"))))
(ert-deftest test-parse-pactl-sinks-verbose-boundary-extra-fields ()
"Test that extra fields between sinks are ignored."
(let* ((output (concat "Sink #65\n\tState: IDLE\n\tName: sink-a\n\tDescription: Sink A\n\tMute: no\n"
"\tDriver: PipeWire\n\tSample Specification: s16le 2ch 48000Hz\n"
"Sink #66\n\tState: SUSPENDED\n\tName: sink-b\n\tDescription: Sink B\n\tMute: no\n"))
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (= 2 (length result)))
(should (equal "sink-a" (nth 0 (car result))))
(should (equal "sink-b" (nth 0 (cadr result))))))
@@ -78,7 +78,7 @@
(ert-deftest test-parse-pactl-sinks-verbose-boundary-description-with-parens ()
"Test descriptions containing parentheses are captured fully."
(let* ((output "Sink #91\n\tState: SUSPENDED\n\tName: hdmi-output\n\tDescription: Radeon (HDMI 2) Output\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (equal "Radeon (HDMI 2) Output" (nth 1 (car result))))))
;;; Error Cases
@@ -86,7 +86,7 @@
(ert-deftest test-parse-pactl-sinks-verbose-error-malformed-no-name ()
"Test that sink entries without Name field are skipped."
(let* ((output "Sink #65\n\tState: SUSPENDED\n\tDescription: Orphan\n\tMute: no\n")
- (result (cj/recording--parse-pactl-sinks-verbose output)))
+ (result (cj/recording--parse-pactl-verbose output "Sink")))
(should (null result))))
(provide 'test-video-audio-recording--parse-pactl-sinks-verbose)