package audio import ( "testing" "time" ) func TestBuildAttribution(t *testing.T) { params := AttributionParams{ Word: "ябълка", Model: "gpt-4o-mini-tts", Voice: "alloy", Instruction: "Speak clearly.", ProcessedText: "ябълка...", Speed: 1.25, GeneratedAt: time.Date(2026, time.April, 1, 15, 4, 5, 0, time.UTC), } tests := []struct { name string got string want string }{ { name: "openai", got: BuildOpenAIAttribution(params), want: "Audio generated by OpenAI TTS\n\n" + "Bulgarian word: ябълка\n" + "Model: gpt-4o-mini-tts\n" + "Voice: alloy\n" + "Speed: 1.25\n\n" + "Voice instructions:\nSpeak clearly.\n\n" + "Processed text sent to TTS: ябълка...\n\n" + "Generated at: 2026-04-01 15:04:05\n", }, { name: "gemini", got: BuildGeminiAttribution(params), want: "Audio generated by Google Gemini TTS\n\n" + "Bulgarian word: ябълка\n" + "Model: gpt-4o-mini-tts\n" + "Voice: alloy\n" + "Speed: 1.25\n\n" + "Voice instructions:\nSpeak clearly.\n\n" + "Processed text sent to TTS: ябълка...\n\n" + "Generated at: 2026-04-01 15:04:05\n", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if tt.got != tt.want { t.Fatalf("unexpected attribution output\nwant:\n%q\n\ngot:\n%q", tt.want, tt.got) } }) } }