package router import "testing" func TestReminderCancellationReportIsChatAndNeverAMutation(t *testing.T) { g := ReminderCancellationReportGrammar() for _, utterance := range []string{ "я отменил напоминание про молоко", "ну я удалил будильник на девять", "I cancelled the reminder", "я не отменил напоминание про врача", } { decision, matched, accepted := g.Evaluate(utterance) if !matched || !accepted || decision.Intent != IntentChat || decision.Slots.HasFn { t.Errorf("%q = %+v, matched=%v accepted=%v; want non-mutating chat", utterance, decision, matched, accepted) } } } func TestReminderCancellationReportDeclinesRequestsAndQuestions(t *testing.T) { g := ReminderCancellationReportGrammar() for _, utterance := range []string{ "отмени напоминание про молоко", "как отменить напоминание про молоко?", "я хочу отменить напоминание про молоко", "запомни: я отменил напоминание про молоко", "он сказал: я отменил напоминание", } { if decision, matched, accepted := g.Evaluate(utterance); matched || accepted { t.Errorf("%q was claimed as %+v", utterance, decision) } } }