Enable audio output list even with only one device

This commit is contained in:
NeilClack
2026-08-08 00:23:33 -05:00
parent 2212cc9b78
commit 7cfbadf169
+7
View File
@@ -12,6 +12,10 @@ func TestCurrentDeviceIndex(t *testing.T) {
{Name: "Built-in Audio Digital Stereo (HDMI)", Label: "HDMI | Monitor | TV"},
}
singleDevice := []mixer.Device{
{Name: "Built-in Audio Analog Stereo", Label: "Internal Speakers"},
}
tests := []struct {
name string
devices []mixer.Device
@@ -24,6 +28,9 @@ func TestCurrentDeviceIndex(t *testing.T) {
{"exact first device match", devices, "Built-in Audio Analog Stereo", 1},
{"exact second device match", devices, "Built-in Audio Digital Stereo (HDMI)", 2},
{"no match", devices, "USB Audio", -1},
{"single device, default", singleDevice, "", 0},
{"single device, exact match", singleDevice, "Built-in Audio Analog Stereo", 1},
{"single device, no match", singleDevice, "USB Audio", -1},
}
for _, tt := range tests {