Documentation
¶
Overview ¶
Package speakercontract holds test-only conformance helpers that speaker provider tests use to assert the public speaker contracts: complete diarization results, well-formed realtime frames, unknown labels left unattributed, and provider errors that name the provider without leaking credentials.
Index ¶
- func AssertDiarizationResult(t testing.TB, result *speaker.DiarizationResult)
- func AssertKnownAttribution(t testing.TB, result *speaker.DiarizationResult, wantName string)
- func AssertProviderError(t testing.TB, err error, provider string)
- func AssertSpeakerFrame(t testing.TB, frame *speaker.SpeakerFrame)
- func AssertUnknownIsUnattributed(t testing.TB, raw any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDiarizationResult ¶
func AssertDiarizationResult(t testing.TB, result *speaker.DiarizationResult)
AssertDiarizationResult fails t unless result is non-nil, names its provider and model, carries text, reports a level stronger than speaker.IdentificationNone, and has non-empty words (each with text), segments, and speakers.
func AssertKnownAttribution ¶
func AssertKnownAttribution(t testing.TB, result *speaker.DiarizationResult, wantName string)
AssertKnownAttribution runs AssertDiarizationResult and then fails t unless some segment or speaker carries wantName as its DisplayName or PersonID.
func AssertProviderError ¶
AssertProviderError fails t unless err is non-nil, mentions provider case-insensitively, and contains none of the secret-shaped fragments a provider response body could leak.
func AssertSpeakerFrame ¶
func AssertSpeakerFrame(t testing.TB, frame *speaker.SpeakerFrame)
AssertSpeakerFrame fails t unless frame is non-nil, names its provider and model, has a positive Sequence, and carries text or words (each word with text).
func AssertUnknownIsUnattributed ¶
AssertUnknownIsUnattributed fails t unless speaker.NormalizeSpeakerLabel maps raw to the empty, unattributed label.
Types ¶
This section is empty.