package eval import "testing" func TestAddressTimeWordDoesNotBlind(t *testing.T) { // A nudge that opens with a time word must still be caught. Without the // time words in the stoplist, "сегодня" was read as the third party. for _, s := range []string{ "сегодня он не ел 11 дней", "вчера он не пил воду", "опять он забыл про таблетки", } { if r := checkAddress(s); r.Pass { t.Errorf("checkAddress(%q) passed, want a third-person failure", s) } } // Still must not fire when a third party really is named. for _, s := range []string{ "сегодня сервис упал, он не отвечает", "ты не пил воду четыре часа", } { if r := checkAddress(s); !r.Pass { t.Errorf("checkAddress(%q) failed: %s", s, r.Detail) } } }