package pronunciation import ( "speech-learning-api/internal/domain" "strings" "testing" ) func TestNativePlanReasonPreservesEvidence(t *testing.T) { for _, mode := range []string{"general", "targeted", "transfer"} { target := &domain.PronunciationTarget{Kind: "phoneme", Symbol: "θ", Samples: 3, Mean: 64, State: "needs_practice"} plan := domain.PronunciationPlan{Mode: mode, Category: "targeted", Target: target, RequiredWords: []string{"three"}, Reason: "historical German reason"} if mode == "general" { plan.Target = nil } SetNativeLanguage(&plan, "ru-RU") if plan.NativeLanguage != "ru-RU" || plan.Reason == "historical German reason" || plan.RequiredWords[0] != "three" || target.Samples != 3 || target.Mean != 64 { t.Fatal(plan) } if mode == "transfer" && !strings.Contains(plan.Reason, "ещё должно быть проверено Azure") { t.Fatal("transfer presented as confirmed", plan.Reason) } } }