Add a test for a custom OutputProtocol-conforming type#235
Add a test for a custom OutputProtocol-conforming type#235itingliu wants to merge 5 commits intoswiftlang:mainfrom
Conversation
itingliu
commented
Apr 8, 2026
- Implement unimplemented functions. Replace fatalError wtih comments explaining why the function is no-op
- Add a test for custom output type
- Remove the comment that discourages providing a custom Output type
| var array: [UInt8] = [] | ||
| for index in 0..<span.byteCount { | ||
| array.append(span.unsafeLoad(fromByteOffset: index, as: UInt8.self)) | ||
| span.withUnsafeBytes { ptr in |
There was a problem hiding this comment.
(not a issue) This TODO was more about switching to a String initializer that takes a Span directly. I don't think that API is ready yet unfortunately.
There was a problem hiding this comment.
Yeah I know the intention. I was looking for it so eagerly the other day too. For now at least this change stops us from potentially reallocating the array... still need a Span one though unfortunately.
| #endif | ||
|
|
||
| @Suite(.serialized) | ||
| struct ProtocolConformanceTests { |
There was a problem hiding this comment.
(nit) Any particular reason to create a new test file instead of just reusing IntegrationTests?
There was a problem hiding this comment.
I'm used to having a struct for one particular kind of test, so I created another one here. Honestly I didn't look closely what IntegrationTest contains. I can move back if you prefer
There was a problem hiding this comment.
Ahh not at all. It's probably a good idea to split them up anyways.
1374cae to
69bdd32
Compare
|
@swift-ci please test |