]> git.giacomolli.uk - onechat/blobdiff - daemon_test.go
Check spacing between Go statement blocks
[onechat] / daemon_test.go
index 6a8cd3e5337b07c14e17a7d3125668f2704e7e54..bfb4efbcc77e2df7b4576d6e7a29f63a14e79ff0 100644 (file)
@@ -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))
        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
                }
 
                        return
                }
 
@@ -29,6 +30,7 @@ func TestClientsSeeTheTurnAsItHappens(t *testing.T) {
        second.WaitFor(t, "[connected to OneChat]")
 
        first.Type("Run echo hi.")
        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())
        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())
@@ -121,6 +123,7 @@ func TestDaemonLogHasATimeStampOnlyOutsideTheJournal(t *testing.T) {
                        t.Setenv("JOURNAL_STREAM", tc.journal)
 
                        var out strings.Builder
                        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())
                })
                        daemonLogger(&out, "onechat: ").Print("the agent is ready")
                        require.Regexp(t, tc.line, out.String())
                })