X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/75b9579355e1adcdbb1255a7e8e4582e0a431f3d..39d1a3fd09f8255298590b4413115ae72e0e3928:/daemon_test.go?ds=inline diff --git a/daemon_test.go b/daemon_test.go index 9f45792..bfb4efb 100644 --- a/daemon_test.go +++ b/daemon_test.go @@ -16,6 +16,7 @@ func TestClientsSeeTheTurnAsItHappens(t *testing.T) { server.reply = func(w http.ResponseWriter, call ModelFakeCall) { if call.number == 0 { modelWriteEvents(w, modelCompletedEvent([]any{modelFunctionCallItem("fc_1", "call_1", "shell", `{"command":"echo hi"}`)}, 100, 0, 5)) + return } @@ -29,6 +30,7 @@ func TestClientsSeeTheTurnAsItHappens(t *testing.T) { second.WaitFor(t, "[connected to OneChat]") first.Type("Run echo hi.") + for _, client := range []*TerminalTestClient{first, second} { client.WaitFor(t, "[done]") require.Equal(t, "[connected to OneChat]\n[working]\n[tool] shell {\"command\":\"echo hi\"}\n[result] hi\nIt said hi.\n[done]\n", client.Output()) @@ -50,7 +52,7 @@ func TestStopInterruptsTheTurn(t *testing.T) { close(release) }) - server.reply = func(w http.ResponseWriter, call ModelFakeCall) { + server.reply = func(_ http.ResponseWriter, _ ModelFakeCall) { close(arrived) <-release } @@ -121,6 +123,7 @@ func TestDaemonLogHasATimeStampOnlyOutsideTheJournal(t *testing.T) { t.Setenv("JOURNAL_STREAM", tc.journal) var out strings.Builder + daemonLogger(&out, "onechat: ").Print("the agent is ready") require.Regexp(t, tc.line, out.String()) })