(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func TestContextWithRunAndStep(t *testing.T) { |
| 72 | t.Parallel() |
| 73 | |
| 74 | rc := &chatdebug.RunContext{RunID: uuid.New(), ChatID: uuid.New()} |
| 75 | sc := &chatdebug.StepContext{StepID: uuid.New(), RunID: rc.RunID, ChatID: rc.ChatID} |
| 76 | |
| 77 | ctx := chatdebug.ContextWithStep( |
| 78 | chatdebug.ContextWithRun(context.Background(), rc), |
| 79 | sc, |
| 80 | ) |
| 81 | |
| 82 | gotRun, ok := chatdebug.RunFromContext(ctx) |
| 83 | require.True(t, ok) |
| 84 | require.Same(t, rc, gotRun) |
| 85 | |
| 86 | gotStep, ok := chatdebug.StepFromContext(ctx) |
| 87 | require.True(t, ok) |
| 88 | require.Same(t, sc, gotStep) |
| 89 | } |
| 90 | |
| 91 | func TestContextWithRunPanicsOnNil(t *testing.T) { |
| 92 | t.Parallel() |
nothing calls this directly
no test coverage detected