package audio import "testing" func TestSpeechRequestApply(t *testing.T) { base := SpeechRequest{Input: "hello"} got := base.Apply(WithVoice("af_heart"), WithFormat("wav"), WithSpeed(1.5)) if got.Input != "hello" { t.Errorf("Input = %q, want %q", got.Input, "hello") } if got.Voice != "af_heart" || got.Format != "wav" || got.Speed != 1.5 { t.Errorf("got = %+v", got) } // Apply must not mutate the receiver (options apply to a copy). if base.Voice != "" || base.Format != "" || base.Speed != 0 { t.Errorf("base mutated: %+v", base) } } func TestTranscriptionRequestApply(t *testing.T) { base := TranscriptionRequest{Audio: []byte{1, 2, 3}} got := base.Apply(WithLanguage("en"), WithPrompt("names")) if got.Language != "en" || got.Prompt != "names" { t.Errorf("got = %+v", got) } if base.Language != "" || base.Prompt != "" { t.Errorf("base mutated: %+v", base) } } func TestApplyModelOptions(t *testing.T) { // No options yet; just verify they return usable zero configs. _ = ApplySpeechModelOptions(nil) _ = ApplyTranscriptionModelOptions(nil) }