(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func 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 |
nothing calls this directly
no test coverage detected