MCPcopy Index your code
hub / github.com/docker/docker-agent / TestUserMessageAt_UsesProvidedClock

Function TestUserMessageAt_UsesProvidedClock

pkg/session/clock_test.go:58–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestUserMessageAt_UsesProvidedClock(t *testing.T) {
59 t.Parallel()
60 fixed := time.Date(2024, 6, 15, 12, 0, 0, 0, time.UTC)
61
62 msg := UserMessageAt(fixed, "hello")
63
64 if msg.Message.Role != chat.MessageRoleUser {
65 t.Errorf("Role = %v, want user", msg.Message.Role)
66 }
67 if msg.Message.CreatedAt != fixed.Format(time.RFC3339) {
68 t.Errorf("CreatedAt = %q, want %q", msg.Message.CreatedAt, fixed.Format(time.RFC3339))
69 }
70 if msg.Message.Content != "hello" {
71 t.Errorf("Content = %q, want %q", msg.Message.Content, "hello")
72 }
73}
74
75func TestSystemMessageAt_UsesProvidedClock(t *testing.T) {
76 t.Parallel()

Callers

nothing calls this directly

Calls 1

UserMessageAtFunction · 0.85

Tested by

no test coverage detected