Files

16 lines
550 B
Go
Raw Permalink Normal View History

2026-09-06 17:04:11 +08:00
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")
}
}