package router import "testing" func TestPublicCurrentVersionQuestionNamesTheWorld(t *testing.T) { g := PublicCurrentVersionGrammar() for _, utterance := range []string{ "какая последняя версия языка Go?", "какой сейчас актуальный релиз PostgreSQL?", "what is the latest supported Ubuntu release?", } { decision, matched, accepted := g.Evaluate(utterance) if !matched || !accepted || decision.Intent != IntentQuery || decision.Source != SourceWorld { t.Errorf("%q = %+v, matched=%v accepted=%v; want world query", utterance, decision, matched, accepted) } } } func TestPublicCurrentVersionQuestionRefusesPrivateOrIncompleteFrames(t *testing.T) { g := PublicCurrentVersionGrammar() for _, utterance := range []string{ "какая версия Go у меня установлена?", "какая последняя версия моего документа?", "какой текущий релиз нашего приложения?", "какая актуальная версия своей схемы?", "what is the latest version of my app?", "последняя версия Go вышла вчера", "какая версия будет следующей?", } { if decision, matched, accepted := g.Evaluate(utterance); matched || accepted { t.Errorf("%q was claimed as %+v", utterance, decision) } } }