Preserve latest travel context
This commit is contained in:
@@ -178,6 +178,20 @@ func TestTravelRouteWithKnownOriginDoesNotAskForTicketDate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTravelContextUsesNewestLocationRegardlessOfRepositoryOrder(t *testing.T) {
|
||||
history := []interaction.HumanUtterance{
|
||||
{Content: "я сейчас в Санкт-Петербурге", ReceivedAtUnixMillis: 200},
|
||||
{Content: "я сейчас в Москве", ReceivedAtUnixMillis: 300},
|
||||
{Content: "я сейчас в Казани", ReceivedAtUnixMillis: 100},
|
||||
}
|
||||
if got := TravelSearchClarification("какой ближайший рейс до Сочи?", history); got != "" {
|
||||
t.Fatalf("newest remembered origin was not applied: %q", got)
|
||||
}
|
||||
if got := TravelResearchQuery("какой ближайший рейс до Сочи?", history, time.Time{}); !strings.Contains(got, "из Москве") {
|
||||
t.Fatalf("newest origin missing from travel research query: %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInterpretUtteranceDirectiveRecordsOutcomeWithoutExecution(t *testing.T) {
|
||||
result := interpretForTest(t, "Поменяй базу на УПО1.", activeFocus("upo", "УПО"), "")
|
||||
if result.Interpretation.SpeechAct != interaction.SpeechActDirective {
|
||||
|
||||
Reference in New Issue
Block a user