package orchestration import "testing" func TestNativeSubtitleSpeakerRequiresExplicitMatch(t *testing.T) { for _, tc := range []struct{ uid, want string }{{"device", "subject"}, {"bot", "agent"}, {"unknown", ""}, {"", ""}} { got, err := nativeSubtitleSpeaker(tc.uid, "device", "device", "bot", "bot") if got != tc.want || (err != nil) != (tc.want == "") { t.Fatalf("%q => %q %v", tc.uid, got, err) } } if _, err := nativeSubtitleSpeaker("same", "same", "same", "same", "same"); err == nil { t.Fatal("ambiguous speaker accepted") } }