MCPcopy
hub / github.com/docker/docker-agent / TestAppendAndRender

Function TestAppendAndRender

pkg/tui/components/transcript/transcript_test.go:31–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestAppendAndRender(t *testing.T) {
32 t.Parallel()
33 tr := newTestTranscript()
34
35 _ = tr.Append(types.User("hello"))
36 _ = tr.Append(types.Agent(types.MessageTypeAssistant, testAgent, "hi there"))
37
38 out := tr.Render(80)
39 assert.Contains(t, out, "hello")
40 assert.Contains(t, out, "hi there")
41 // One blank separator line between the two messages.
42 assert.Contains(t, out, "\n\n")
43}
44
45func TestAppendToLastMessageStreamsIntoSameMessage(t *testing.T) {
46 t.Parallel()

Callers

nothing calls this directly

Calls 5

UserFunction · 0.92
AgentFunction · 0.92
newTestTranscriptFunction · 0.85
RenderMethod · 0.65
AppendMethod · 0.45

Tested by

no test coverage detected