MCPcopy Index your code
hub / github.com/coder/coder / TestContextWithRunRoundTrip

Function TestContextWithRunRoundTrip

coderd/x/chatd/chatdebug/context_test.go:13–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestContextWithRunRoundTrip(t *testing.T) {
14 t.Parallel()
15
16 rc := &chatdebug.RunContext{
17 RunID: uuid.New(),
18 ChatID: uuid.New(),
19 RootChatID: uuid.New(),
20 ParentChatID: uuid.New(),
21 ModelConfigID: uuid.New(),
22 TriggerMessageID: 11,
23 HistoryTipMessageID: 22,
24 Kind: chatdebug.KindChatTurn,
25 Provider: "anthropic",
26 Model: "claude-sonnet",
27 }
28
29 ctx := chatdebug.ContextWithRun(context.Background(), rc)
30 got, ok := chatdebug.RunFromContext(ctx)
31 require.True(t, ok)
32 require.Same(t, rc, got)
33 require.Equal(t, *rc, *got)
34}
35
36func TestRunFromContextAbsent(t *testing.T) {
37 t.Parallel()

Callers

nothing calls this directly

Calls 4

ContextWithRunFunction · 0.92
RunFromContextFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected