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

Function TestContextWithStepRoundTrip

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

Source from the content-addressed store, hash-verified

42}
43
44func TestContextWithStepRoundTrip(t *testing.T) {
45 t.Parallel()
46
47 sc := &chatdebug.StepContext{
48 StepID: uuid.New(),
49 RunID: uuid.New(),
50 ChatID: uuid.New(),
51 StepNumber: 7,
52 Operation: chatdebug.OperationStream,
53 HistoryTipMessageID: 33,
54 }
55
56 ctx := chatdebug.ContextWithStep(context.Background(), sc)
57 got, ok := chatdebug.StepFromContext(ctx)
58 require.True(t, ok)
59 require.Same(t, sc, got)
60 require.Equal(t, *sc, *got)
61}
62
63func TestStepFromContextAbsent(t *testing.T) {
64 t.Parallel()

Callers

nothing calls this directly

Calls 4

ContextWithStepFunction · 0.92
StepFromContextFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected