(t *testing.T)
| 219 | } |
| 220 | |
| 221 | func 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 | |
| 235 | func TestAdvisorToolInfoDocumentsQuestionLimit(t *testing.T) { |
| 236 | t.Parallel() |
nothing calls this directly
no test coverage detected