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

Function TestAdvisorToolTruncatesLongQuestion

coderd/x/chatd/chatadvisor/tool_test.go:221–233  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func TestAdvisorToolTruncatesLongQuestion(t *testing.T) {
222 t.Parallel()
223
224 var capturedQuestion string
225 tool := advisorToolCapturingQuestion(t, &capturedQuestion)
226 longQuestion := strings.Repeat("界", 2001)
227
228 resp := runAdvisorTool(t, tool, chatadvisor.AdvisorArgs{Question: longQuestion})
229 require.False(t, resp.IsError)
230 require.True(t, utf8.ValidString(capturedQuestion))
231 require.Equal(t, 2000, utf8.RuneCountInString(capturedQuestion))
232 require.Equal(t, strings.Repeat("界", 2000), capturedQuestion)
233}
234
235func TestAdvisorToolInfoDocumentsQuestionLimit(t *testing.T) {
236 t.Parallel()

Callers

nothing calls this directly

Calls 3

runAdvisorToolFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected