@@ -55,7 +55,7 @@ final class Test_Server: XCTestCase {
55
55
response. headerFields,
56
56
[
57
57
. init( " My-Response-UUID " ) !: " abcd " , . init( " My-Tracing-Header " ) !: " 1234 " ,
58
- . contentType: " application/json; charset=utf-8 " ,
58
+ . contentType: " application/json; charset=utf-8 " , . contentLength : " 47 " ,
59
59
]
60
60
)
61
61
let bodyString : String
@@ -87,7 +87,7 @@ final class Test_Server: XCTestCase {
87
87
. init( )
88
88
)
89
89
XCTAssertEqual ( response. status. code, 400 )
90
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " ] )
90
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " , . contentLength : " 40 " ] )
91
91
try await XCTAssertEqualStringifiedData (
92
92
responseBody,
93
93
#"""
@@ -131,7 +131,10 @@ final class Test_Server: XCTestCase {
131
131
XCTAssertEqual ( response. status. code, 201 )
132
132
XCTAssertEqual (
133
133
response. headerFields,
134
- [ . init( " X-Extra-Arguments " ) !: #"{"code":1}"# , . contentType: " application/json; charset=utf-8 " ]
134
+ [
135
+ . init( " X-Extra-Arguments " ) !: #"{"code":1}"# , . contentType: " application/json; charset=utf-8 " ,
136
+ . contentLength: " 35 " ,
137
+ ]
135
138
)
136
139
try await XCTAssertEqualStringifiedData (
137
140
responseBody,
@@ -169,7 +172,7 @@ final class Test_Server: XCTestCase {
169
172
XCTAssertEqual ( response. status. code, 400 )
170
173
XCTAssertEqual (
171
174
response. headerFields,
172
- [ . init( " X-Reason " ) !: " bad%20luck " , . contentType: " application/json; charset=utf-8 " ]
175
+ [ . init( " X-Reason " ) !: " bad%20luck " , . contentType: " application/json; charset=utf-8 " , . contentLength : " 16 " ]
173
176
)
174
177
try await XCTAssertEqualStringifiedData (
175
178
responseBody,
@@ -270,7 +273,10 @@ final class Test_Server: XCTestCase {
270
273
XCTAssertEqual ( response. status. code, 201 )
271
274
XCTAssertEqual (
272
275
response. headerFields,
273
- [ . init( " X-Extra-Arguments " ) !: #"{"code":1}"# , . contentType: " application/json; charset=utf-8 " ]
276
+ [
277
+ . init( " X-Extra-Arguments " ) !: #"{"code":1}"# , . contentType: " application/json; charset=utf-8 " ,
278
+ . contentLength: " 35 " ,
279
+ ]
274
280
)
275
281
try await XCTAssertEqualStringifiedData (
276
282
responseBody,
@@ -363,7 +369,7 @@ final class Test_Server: XCTestCase {
363
369
. init( pathParameters: [ " petId " : " 1 " ] )
364
370
)
365
371
XCTAssertEqual ( response. status. code, 400 )
366
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " ] )
372
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " , . contentLength : " 26 " ] )
367
373
try await XCTAssertEqualStringifiedData (
368
374
responseBody,
369
375
#"""
@@ -386,7 +392,7 @@ final class Test_Server: XCTestCase {
386
392
. init( )
387
393
)
388
394
XCTAssertEqual ( response. status. code, 200 )
389
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " ] )
395
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " , . contentLength : " 17 " ] )
390
396
try await XCTAssertEqualStringifiedData (
391
397
responseBody,
392
398
#"""
@@ -421,7 +427,7 @@ final class Test_Server: XCTestCase {
421
427
. init( )
422
428
)
423
429
XCTAssertEqual ( response. status. code, 200 )
424
- XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " ] )
430
+ XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " , . contentLength : " 10 " ] )
425
431
try await XCTAssertEqualStringifiedData (
426
432
responseBody,
427
433
#"""
@@ -482,7 +488,7 @@ final class Test_Server: XCTestCase {
482
488
. init( )
483
489
)
484
490
XCTAssertEqual ( response. status. code, 200 )
485
- XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " ] )
491
+ XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " , . contentLength : " 10 " ] )
486
492
try await XCTAssertEqualStringifiedData (
487
493
responseBody,
488
494
#"""
@@ -509,7 +515,7 @@ final class Test_Server: XCTestCase {
509
515
. init( )
510
516
)
511
517
XCTAssertEqual ( response. status. code, 200 )
512
- XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " ] )
518
+ XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " , . contentLength : " 10 " ] )
513
519
try await XCTAssertEqualStringifiedData (
514
520
responseBody,
515
521
#"""
@@ -530,7 +536,7 @@ final class Test_Server: XCTestCase {
530
536
. init( )
531
537
)
532
538
XCTAssertEqual ( response. status. code, 200 )
533
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " ] )
539
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " , . contentLength : " 10 " ] )
534
540
try await XCTAssertEqualStringifiedData (
535
541
responseBody,
536
542
#"""
@@ -674,7 +680,7 @@ final class Test_Server: XCTestCase {
674
680
. init( pathParameters: [ " petId " : " 1 " ] )
675
681
)
676
682
XCTAssertEqual ( response. status. code, 200 )
677
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " ] )
683
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " , . contentLength : " 4 " ] )
678
684
try await XCTAssertEqualStringifiedData ( responseBody, Data . efghString)
679
685
}
680
686
@@ -711,7 +717,7 @@ final class Test_Server: XCTestCase {
711
717
. init( pathParameters: [ " petId " : " 1 " ] )
712
718
)
713
719
XCTAssertEqual ( response. status. code, 200 )
714
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " ] )
720
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/octet-stream " , . contentLength : " 4 " ] )
715
721
try await XCTAssertEqualStringifiedData ( responseBody, Data . abcdString)
716
722
let sizes = await chunkSizeCollector. sizes
717
723
XCTAssertEqual ( sizes, [ 4 ] )
@@ -736,7 +742,7 @@ final class Test_Server: XCTestCase {
736
742
. init( pathParameters: [ " petId " : " 1 " ] )
737
743
)
738
744
XCTAssertEqual ( response. status. code, 412 )
739
- XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " ] )
745
+ XCTAssertEqual ( response. headerFields, [ . contentType: " application/json; charset=utf-8 " , . contentLength : " 6 " ] )
740
746
try await XCTAssertEqualStringifiedData ( responseBody, Data . quotedEfghString)
741
747
}
742
748
@@ -759,7 +765,7 @@ final class Test_Server: XCTestCase {
759
765
. init( pathParameters: [ " petId " : " 1 " ] )
760
766
)
761
767
XCTAssertEqual ( response. status. code, 500 )
762
- XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " ] )
768
+ XCTAssertEqual ( response. headerFields, [ . contentType: " text/plain " , . contentLength : " 4 " ] )
763
769
try await XCTAssertEqualStringifiedData ( responseBody, Data . efghString)
764
770
}
765
771
0 commit comments