Merge pull request #1310 from trheyi/main

Fix formatting issues in OpenAI stream lifecycle event tests
This commit is contained in:
Max 2025-11-15 15:37:32 +08:00 committed by GitHub
commit d6155b230f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1288,7 +1288,7 @@ func TestOpenAIStreamLifecycleEvents(t *testing.T) {
handler := func(chunkType context.StreamChunkType, data []byte) int { handler := func(chunkType context.StreamChunkType, data []byte) int {
events = append(events, string(chunkType)) events = append(events, string(chunkType))
switch chunkType { switch chunkType {
case context.ChunkStreamStart: case context.ChunkStreamStart:
streamStartReceived = true streamStartReceived = true
@ -1333,7 +1333,7 @@ func TestOpenAIStreamLifecycleEvents(t *testing.T) {
groupEndReceived = true groupEndReceived = true
var endData context.GroupEndData var endData context.GroupEndData
if err := json.Unmarshal(data, &endData); err == nil { if err := json.Unmarshal(data, &endData); err == nil {
t.Logf("✓ group_end: type=%s, chunks=%d, duration=%dms", t.Logf("✓ group_end: type=%s, chunks=%d, duration=%dms",
endData.Type, endData.ChunkCount, endData.DurationMs) endData.Type, endData.ChunkCount, endData.DurationMs)
if endData.ChunkCount <= 0 { if endData.ChunkCount <= 0 {
t.Error("group_end should have chunk_count > 0") t.Error("group_end should have chunk_count > 0")