(t *testing.T)
| 255 | } |
| 256 | |
| 257 | func TestHasPreviousResponseID(t *testing.T) { |
| 258 | t.Parallel() |
| 259 | |
| 260 | emptyID := "" |
| 261 | responseID := "resp-123" |
| 262 | |
| 263 | tests := []struct { |
| 264 | name string |
| 265 | opts fantasy.ProviderOptions |
| 266 | want bool |
| 267 | }{ |
| 268 | { |
| 269 | name: "NilOptions", |
| 270 | }, |
| 271 | { |
| 272 | name: "EmptyID", |
| 273 | opts: fantasy.ProviderOptions{ |
| 274 | fantasyopenai.Name: &fantasyopenai.ResponsesProviderOptions{ |
| 275 | PreviousResponseID: &emptyID, |
| 276 | }, |
| 277 | }, |
| 278 | }, |
| 279 | { |
| 280 | name: "NonEmptyID", |
| 281 | opts: fantasy.ProviderOptions{ |
| 282 | fantasyopenai.Name: &fantasyopenai.ResponsesProviderOptions{ |
| 283 | PreviousResponseID: &responseID, |
| 284 | }, |
| 285 | }, |
| 286 | want: true, |
| 287 | }, |
| 288 | } |
| 289 | |
| 290 | for _, tt := range tests { |
| 291 | t.Run(tt.name, func(t *testing.T) { |
| 292 | t.Parallel() |
| 293 | |
| 294 | got := chatopenai.HasPreviousResponseID(tt.opts) |
| 295 | require.Equal(t, tt.want, got) |
| 296 | }) |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | func TestClearPreviousResponseID(t *testing.T) { |
| 301 | t.Parallel() |
nothing calls this directly
no test coverage detected