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

Function TestSystemMessageAt_UsesProvidedClock

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

Source from the content-addressed store, hash-verified

73}
74
75func TestSystemMessageAt_UsesProvidedClock(t *testing.T) {
76 t.Parallel()
77 fixed := time.Date(2024, 6, 15, 12, 0, 0, 0, time.UTC)
78
79 msg := SystemMessageAt(fixed, "you are a helpful assistant")
80
81 if msg.Message.Role != chat.MessageRoleSystem {
82 t.Errorf("Role = %v, want system", msg.Message.Role)
83 }
84 if msg.Message.CreatedAt != fixed.Format(time.RFC3339) {
85 t.Errorf("CreatedAt = %q, want %q", msg.Message.CreatedAt, fixed.Format(time.RFC3339))
86 }
87}
88
89func TestImplicitUserMessageAt_IsImplicitAndUsesClock(t *testing.T) {
90 t.Parallel()

Callers

nothing calls this directly

Calls 1

SystemMessageAtFunction · 0.85

Tested by

no test coverage detected