swift-sdk/Tests/MCPTests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ayal Spitz f6e401aa97
Fix event stream line parsing to handle CRLF and empty lines correctly (#89)
* Optimized code in `connectToEventStream` to use `.lines` computed value of `AsyncSequence` to produce a `AsyncLineSequence` instead of building a lines manually.

* - Reverter use of `lines` (it swallows newlines)
- Fiexed original issue I experienced with line 229 `while let newlineIndex = buffer.firstIndex(of: "\n") {` not handling "\r\n" properly
- Added unit test to test for "\r\n" scenario
- Simplified `end of event` test - `line` creation trims newline, added code trims carriage return. Only thing that should be left is an empty line
2025-04-27 06:50:08 -07:00
..
Helpers Add support for JSON-RPC batching (#67) 2025-04-10 12:13:41 -07:00
ClientTests.swift Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00
HTTPClientTransportTests.swift Fix event stream line parsing to handle CRLF and empty lines correctly (#89) 2025-04-27 06:50:08 -07:00
IDTests.swift Initial implementation 2025-02-11 15:22:35 -08:00
NotificationTests.swift Update AnyNotification to include notification params (#86) 2025-04-27 06:47:38 -07:00
PromptTests.swift Add support for audio content in prompts and tool results (#73) 2025-04-15 05:41:28 -07:00
RequestTests.swift Add unit test to check that AnyRequest handles missing parameters (#24) 2025-03-19 05:41:50 -07:00
ResourceTests.swift Allow params field to be omitted in requests for methods that don't require them (#17) 2025-03-17 05:26:47 -07:00
ResponseTests.swift Add support for JSON-RPC batching (#67) 2025-04-10 12:13:41 -07:00
RoundtripTests.swift Add support for Linux with glibc (#61) 2025-04-10 05:22:56 -07:00
ServerTests.swift Send initialized notification from client instead of server (#85) 2025-04-21 14:43:33 -07:00
StdioTransportTests.swift Add streamable HTTP transport for clients (#70) 2025-04-15 09:06:29 -07:00
ToolTests.swift Implement Tool.Annotations (#47) 2025-04-15 05:42:44 -07:00