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

Function TestIsChatAgent

coderd/x/chatd/internal/agentselect/agentselect_test.go:183–231  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestIsChatAgent(t *testing.T) {
184 t.Parallel()
185
186 tests := []struct {
187 name string
188 input string
189 want bool
190 }{
191 {
192 name: "ExactSuffix",
193 input: "agent-coderd-chat",
194 want: true,
195 },
196 {
197 name: "UppercaseSuffix",
198 input: "agent-CODERD-CHAT",
199 want: true,
200 },
201 {
202 name: "MixedCaseSuffix",
203 input: "agent-Coderd-Chat",
204 want: true,
205 },
206 {
207 name: "NoSuffix",
208 input: "my-agent",
209 want: false,
210 },
211 {
212 name: "SuffixOnly",
213 input: "-coderd-chat",
214 want: true,
215 },
216 {
217 name: "PartialSuffix",
218 input: "agent-coderd",
219 want: false,
220 },
221 }
222
223 for _, tt := range tests {
224 tt := tt
225 t.Run(tt.name, func(t *testing.T) {
226 t.Parallel()
227
228 require.Equal(t, tt.want, agentselect.IsChatAgent(tt.input))
229 })
230 }
231}

Callers

nothing calls this directly

Calls 3

IsChatAgentFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected