P0 fixes: - ModelError.Is(): use exact matching instead of substring contains() - shouldClearStickySession: add context param for cancellation/tracing P1 fixes: - TODO stubs: return 501 Not Implemented errors - validateInstanceSignature: deduplicate to shared validateCodeSignature() - Error messages: standardize to English only - http.go: remove pseudo if-else with duplicate branches
20 lines
362 B
Go
20 lines
362 B
Go
package service
|
||
|
||
import (
|
||
"testing"
|
||
|
||
"github.com/stretchr/testify/require"
|
||
)
|
||
|
||
func TestSSEScannerBuf64KPool_GetPutDoesNotPanic(t *testing.T) {
|
||
buf := getSSEScannerBuf64K()
|
||
require.NotNil(t, buf)
|
||
require.Equal(t, sseScannerBuf64KSize, len(buf[:]))
|
||
|
||
buf[0] = 1
|
||
putSSEScannerBuf64K(buf)
|
||
|
||
// 允许传入 nil,确保不会 panic
|
||
putSSEScannerBuf64K(nil)
|
||
}
|