TestEvent | Event structure creation with all fields | Event object correctly stores ID, Event, Data, and Retry fields |
TestClient_Close | Client close operation | Close() can be called multiple times safely without panic, Done channel is closed |
TestClient_Send | Sending event to client | Event is successfully sent through the Events channel |
TestClient_SendData | Sending data-only event | Data is wrapped in Event struct and sent through channel |
TestClient_SendEvent | Sending named event with data | Event type and data are correctly packaged and sent |
TestClient_SendOnClosedChannel | Sending to closed client | Send operation does not block or panic after client is closed |
TestClient_send | Internal send formatting with all fields | Output contains properly formatted id, event, data, and retry fields |
TestClient_sendMultilineData | Multiline data formatting | Each line is prefixed with βdata:β in the output |
TestClient_sendEmptyFields | Send with minimal event data | Empty fields (ID, Event, Retry=0) are omitted from output |
TestBroker | Broker client management | Clients register successfully, receive broadcasts, and unregister on disconnect |
TestBroker_BroadcastEvent | Broadcasting named events | All registered clients receive the event with correct type and data |
TestBroker_Broadcast | Broadcasting full Event object | Event with all fields (ID, Event, Data, Retry) is delivered to clients |
TestBroker_BroadcastWithFullBuffer | Broadcast to client with full buffer | Broadcast operation does not block, skips clients with full buffers |
TestOptions | Options structure configuration | BufferSize and Retry values are correctly stored |
TestNew | Middleware creation with New() | Middleware is successfully created with default options |
TestWithOptions_DefaultValues | Middleware with empty options | Default values (BufferSize: 10, Retry: 3000) are applied |
TestWithOptions_CustomValues | Middleware with custom options | Custom BufferSize and Retry values are used |
TestSSE_NonSSERequest | Non-SSE Accept header | Request passes through to next handler, normal response returned |
TestSSE_EmptyAcceptAllowed | Empty Accept header | SSE connection is allowed (treated as accepting all types) |
TestSSE_WildcardAccept | Accept: / header | SSE connection is allowed (wildcard matches event-stream) |