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

Function TestSubagentFallbackChatTitle

coderd/x/chatd/subagent_internal_test.go:35–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33)
34
35func TestSubagentFallbackChatTitle(t *testing.T) {
36 t.Parallel()
37
38 tests := []struct {
39 name string
40 input string
41 want string
42 }{
43 {
44 name: "EmptyPrompt",
45 input: "",
46 want: "New Chat",
47 },
48 {
49 name: "ShortPrompt",
50 input: "Open Firefox",
51 want: "Open Firefox",
52 },
53 {
54 name: "LongPrompt",
55 input: "Please open the Firefox browser and navigate to the settings page",
56 want: "Please open the Firefox browser and...",
57 },
58 }
59
60 for _, tt := range tests {
61 t.Run(tt.name, func(t *testing.T) {
62 t.Parallel()
63 got := subagentFallbackChatTitle(tt.input)
64 assert.Equal(t, tt.want, got)
65 })
66 }
67}
68
69// newInternalTestServer creates a Server for internal tests with
70// custom provider API keys. The server is automatically closed

Callers

nothing calls this directly

Calls 3

RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected