package eval import ( "strings" "testing" ) // TestAddressReportsEveryBreak — the real reply from a nudge eval run broke in // two ways at once and the check named only the plural. Both must print: a // half-reported failure reads as a milder problem than it is. func TestAddressReportsEveryBreak(t *testing.T) { body := "Смотрите на его потребление воды." res := checkAddress(body) if res.Pass { t.Fatalf("checkAddress passed %q", body) } for _, want := range []string{"смотрите", "его"} { if !strings.Contains(res.Detail, want) { t.Errorf("detail %q does not name %q", res.Detail, want) } } } // One word repeated is one problem, so the detail must not say it twice. func TestAddressDeduplicates(t *testing.T) { res := checkAddress("Вам стоит поесть, вам это нужно.") if res.Pass { t.Fatal("expected failure") } if n := strings.Count(res.Detail, "formal"); n != 1 { t.Errorf("detail repeats the same break %d times: %q", n, res.Detail) } }