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

Function TestMessages

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

Source from the content-addressed store, hash-verified

249}
250
251func TestMessages(t *testing.T) {
252 t.Parallel()
253 tr := newTestTranscript()
254
255 assert.Empty(t, tr.Messages())
256
257 _ = tr.Append(types.User("hello"))
258 _ = tr.AppendToLastMessage(testAgent, "hi")
259
260 msgs := tr.Messages()
261 require.Len(t, msgs, 2)
262 assert.Equal(t, types.MessageTypeUser, msgs[0].Type)
263 assert.Equal(t, "hi", msgs[1].Content)
264}

Callers

nothing calls this directly

Calls 6

UserFunction · 0.92
newTestTranscriptFunction · 0.85
MessagesMethod · 0.80
AppendToLastMessageMethod · 0.65
LenMethod · 0.65
AppendMethod · 0.45

Tested by

no test coverage detected