Enable audio output list even with only one device
This commit is contained in:
@@ -12,6 +12,10 @@ func TestCurrentDeviceIndex(t *testing.T) {
|
|||||||
{Name: "Built-in Audio Digital Stereo (HDMI)", Label: "HDMI | Monitor | TV"},
|
{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 {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
devices []mixer.Device
|
devices []mixer.Device
|
||||||
@@ -24,6 +28,9 @@ func TestCurrentDeviceIndex(t *testing.T) {
|
|||||||
{"exact first device match", devices, "Built-in Audio Analog Stereo", 1},
|
{"exact first device match", devices, "Built-in Audio Analog Stereo", 1},
|
||||||
{"exact second device match", devices, "Built-in Audio Digital Stereo (HDMI)", 2},
|
{"exact second device match", devices, "Built-in Audio Digital Stereo (HDMI)", 2},
|
||||||
{"no match", devices, "USB Audio", -1},
|
{"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 {
|
for _, tt := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user