@@ -29,18 +29,6 @@ final class Test_ServerSentEventsDecoding: Test_Runtime {
29
29
}
30
30
}
31
31
32
- func _test( input: String , output: [ ServerSentEvent ] , file: StaticString = #filePath, line: UInt = #line, terminatingData: ArraySlice < UInt8 > , eventCountOffset: Int )
33
- async throws {
34
- try await _test (
35
- input: input,
36
- output: output,
37
- file: file,
38
- line: line,
39
- terminate: { incomingData in incomingData == terminatingData } ,
40
- eventCountOffset: eventCountOffset
41
- )
42
- }
43
-
44
32
func test( ) async throws {
45
33
// Simple event.
46
34
try await _test (
@@ -118,25 +106,6 @@ final class Test_ServerSentEventsDecoding: Test_Runtime {
118
106
} ,
119
107
eventCountOffset: - 2
120
108
)
121
-
122
- try await _test (
123
- input: #"""
124
- data: hello
125
- data: world
126
-
127
- data: [DONE]
128
-
129
- data: hello2
130
- data: world2
131
-
132
-
133
- """# ,
134
- output: [
135
- . init( data: " hello \n world " )
136
- ] ,
137
- terminatingData: ArraySlice < UInt8 > ( Data ( " [DONE] " . utf8) ) ,
138
- eventCountOffset: - 2
139
- )
140
109
}
141
110
func _testJSONData< JSONType: Decodable & Hashable & Sendable > (
142
111
input: String ,
@@ -155,22 +124,6 @@ final class Test_ServerSentEventsDecoding: Test_Runtime {
155
124
}
156
125
}
157
126
158
- func _testJSONData< JSONType: Decodable & Hashable & Sendable > (
159
- input: String ,
160
- output: [ ServerSentEventWithJSONData < JSONType > ] ,
161
- file: StaticString = #filePath,
162
- line: UInt = #line,
163
- terminatingDataSequence: ArraySlice < UInt8 > ?
164
- ) async throws {
165
- try await _testJSONData (
166
- input: input,
167
- output: output,
168
- file: file,
169
- terminate: { incomingData in incomingData == ArraySlice < UInt8 > ( Data ( " [DONE] " . utf8) )
170
- }
171
- )
172
- }
173
-
174
127
struct TestEvent : Decodable , Hashable , Sendable { var index : Int }
175
128
func testJSONData( ) async throws {
176
129
// Simple event.
@@ -222,33 +175,6 @@ final class Test_ServerSentEventsDecoding: Test_Runtime {
222
175
incomingData == ArraySlice < UInt8 > ( Data ( " [DONE] " . utf8) )
223
176
}
224
177
)
225
-
226
- try await _testJSONData (
227
- input: #"""
228
- event: event1
229
- id: 1
230
- data: {"index":1}
231
-
232
- event: event2
233
- id: 2
234
- data: {
235
- data: "index": 2
236
- data: }
237
-
238
- data: [DONE]
239
-
240
- event: event3
241
- id: 1
242
- data: {"index":3}
243
-
244
-
245
- """# ,
246
- output: [
247
- . init( event: " event1 " , data: TestEvent ( index: 1 ) , id: " 1 " ) ,
248
- . init( event: " event2 " , data: TestEvent ( index: 2 ) , id: " 2 " ) ,
249
- ] ,
250
- terminatingDataSequence: ArraySlice < UInt8 > ( Data ( " [DONE] " . utf8) )
251
- )
252
178
}
253
179
}
254
180
0 commit comments