mavend: say the act replies from the file (V-504)
Also fixes a flake this stack introduced: the feeds test matched "ничего нового" as a substring, and query_ru_v1.json can answer with "в лентах тихо". It asks the entry now, like the others.
This commit is contained in:
@@ -8,8 +8,7 @@ import (
|
||||
"github.com/kami/maven/internal/phraser"
|
||||
)
|
||||
|
||||
// TestFallbackPersona scores every line in fallbacks_ru_v1.json, ack_ru_v1.json and
|
||||
// query_ru_v1.json on the persona checks the nudges already pass. These lines are
|
||||
// TestFallbackPersona scores every line in every hand-written line family on the persona checks the nudges already pass. These lines are
|
||||
// heard out loud and they live in a JSON file now, so a reworded variant that
|
||||
// says "рад" or "вы" would otherwise reach him with nothing in between.
|
||||
//
|
||||
@@ -38,6 +37,11 @@ func TestFallbackPersona(t *testing.T) {
|
||||
}
|
||||
variants := append(fb.Variants(), ack.Variants()...)
|
||||
variants = append(variants, qry.Variants()...)
|
||||
act, err := phraser.LoadActs(rand.NewSource(20260804))
|
||||
if err != nil {
|
||||
t.Fatalf("LoadActs: %v", err)
|
||||
}
|
||||
variants = append(variants, act.Variants()...)
|
||||
if len(variants) == 0 {
|
||||
t.Fatal("no variants — the file loaded empty")
|
||||
}
|
||||
@@ -45,7 +49,8 @@ func TestFallbackPersona(t *testing.T) {
|
||||
// The placeholders stand for his own words and carry no persona.
|
||||
body := v
|
||||
for _, ph := range []string{"{sources}", "{key}", "{value}", "{fn}", "{text}", "{when}", "{items}",
|
||||
"{location}", "{temp}", "{condition}", "{tail}"} {
|
||||
"{location}", "{temp}", "{condition}", "{tail}", "{out}", "{name}",
|
||||
"{entity}", "{count}", "{word}"} {
|
||||
body = strings.ReplaceAll(body, ph, "вода")
|
||||
}
|
||||
for _, r := range RunChecks(Case{}, body, "neutral") {
|
||||
|
||||
Reference in New Issue
Block a user