MCPcopy Create free account
hub / github.com/coder/coder / TestIncludeFromChat

Function TestIncludeFromChat

coderd/x/chatd/chatopenai/options_test.go:159–193  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

157}
158
159func TestIncludeFromChat(t *testing.T) {
160 t.Parallel()
161
162 tests := []struct {
163 name string
164 values []string
165 want []fantasyopenai.IncludeType
166 }{
167 {name: "Nil"},
168 {name: "Empty", values: []string{}, want: []fantasyopenai.IncludeType{}},
169 {
170 name: "ValidAndInvalid",
171 values: []string{
172 " " + string(fantasyopenai.IncludeReasoningEncryptedContent) + " ",
173 string(fantasyopenai.IncludeFileSearchCallResults),
174 "unsupported",
175 string(fantasyopenai.IncludeMessageOutputTextLogprobs),
176 },
177 want: []fantasyopenai.IncludeType{
178 fantasyopenai.IncludeReasoningEncryptedContent,
179 fantasyopenai.IncludeFileSearchCallResults,
180 fantasyopenai.IncludeMessageOutputTextLogprobs,
181 },
182 },
183 }
184
185 for _, tt := range tests {
186 t.Run(tt.name, func(t *testing.T) {
187 t.Parallel()
188
189 got := chatopenai.IncludeFromChat(tt.values)
190 require.Equal(t, tt.want, got)
191 })
192 }
193}
194
195func TestEnsureResponseIncludes(t *testing.T) {
196 t.Parallel()

Callers

nothing calls this directly

Calls 3

IncludeFromChatFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected