File tree Expand file tree Collapse file tree 2 files changed +30
-24
lines changed Expand file tree Collapse file tree 2 files changed +30
-24
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ public struct Metadata: Sendable, Hashable {
170
170
internal mutating func addValue( _ value: Value , forKey key: String ) {
171
171
self . elements. append ( . init( key: key, value: value) )
172
172
}
173
-
173
+
174
174
/// Add the contents of a `Sequence` of key-value pairs to this `Metadata` instance.
175
175
///
176
176
/// - Parameter other: the `Sequence` whose key-value pairs should be added into this `Metadata` instance.
Original file line number Diff line number Diff line change @@ -270,42 +270,48 @@ struct MetadataTests {
270
270
self . otherMetadata. addString ( " value1-2 " , forKey: " key1 " )
271
271
self . metadata. add ( contentsOf: self . otherMetadata)
272
272
273
- #expect( self . metadata == [
274
- " key1 " : " value1-1 " ,
275
- " key2 " : " value2 " ,
276
- " key3 " : " value3 " ,
277
- " key4 " : " value4 " ,
278
- " key5 " : " value5 " ,
279
- " key1 " : " value1-2 " ,
280
- ] )
273
+ #expect(
274
+ self . metadata == [
275
+ " key1 " : " value1-1 " ,
276
+ " key2 " : " value2 " ,
277
+ " key3 " : " value3 " ,
278
+ " key4 " : " value4 " ,
279
+ " key5 " : " value5 " ,
280
+ " key1 " : " value1-2 " ,
281
+ ]
282
+ )
281
283
}
282
284
283
285
@Test ( " Where key is already present with same value " )
284
286
mutating func mergeWhereKeyIsAlreadyPresentWithSameValue( ) async throws {
285
287
self . otherMetadata. addString ( " value1-1 " , forKey: " key1 " )
286
288
self . metadata. add ( contentsOf: self . otherMetadata)
287
289
288
- #expect( self . metadata == [
289
- " key1 " : " value1-1 " ,
290
- " key2 " : " value2 " ,
291
- " key3 " : " value3 " ,
292
- " key4 " : " value4 " ,
293
- " key5 " : " value5 " ,
294
- " key1 " : " value1-1 " ,
295
- ] )
290
+ #expect(
291
+ self . metadata == [
292
+ " key1 " : " value1-1 " ,
293
+ " key2 " : " value2 " ,
294
+ " key3 " : " value3 " ,
295
+ " key4 " : " value4 " ,
296
+ " key5 " : " value5 " ,
297
+ " key1 " : " value1-1 " ,
298
+ ]
299
+ )
296
300
}
297
301
298
302
@Test ( " Where key is not already present " )
299
303
mutating func mergeWhereKeyIsNotAlreadyPresent( ) async throws {
300
304
self . metadata. add ( contentsOf: self . otherMetadata)
301
305
302
- #expect( self . metadata == [
303
- " key1 " : " value1-1 " ,
304
- " key2 " : " value2 " ,
305
- " key3 " : " value3 " ,
306
- " key4 " : " value4 " ,
307
- " key5 " : " value5 "
308
- ] )
306
+ #expect(
307
+ self . metadata == [
308
+ " key1 " : " value1-1 " ,
309
+ " key2 " : " value2 " ,
310
+ " key3 " : " value3 " ,
311
+ " key4 " : " value4 " ,
312
+ " key5 " : " value5 " ,
313
+ ]
314
+ )
309
315
}
310
316
}
311
317
}
You can’t perform that action at this time.
0 commit comments