@@ -279,6 +279,10 @@ final class Test_FieldMask: XCTestCase, PBTestHelpers {
279
279
let m7 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
280
280
let m8 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
281
281
XCTAssertEqual ( m7. union ( m8) . paths, [ " a " , " b " ] )
282
+
283
+ let m9 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " a " ] )
284
+ let m10 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
285
+ XCTAssertEqual ( m9. union ( m10) . paths, [ " a " , " b " ] )
282
286
}
283
287
284
288
// Checks `intersect` func of fieldMask.
@@ -298,6 +302,10 @@ final class Test_FieldMask: XCTestCase, PBTestHelpers {
298
302
let m7 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
299
303
let m8 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
300
304
XCTAssertEqual ( m7. intersect ( m8) . paths, [ " a " , " b " ] )
305
+
306
+ let m9 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " a " ] )
307
+ let m10 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
308
+ XCTAssertEqual ( m9. intersect ( m10) . paths, [ " a " ] )
301
309
}
302
310
303
311
// Checks `substract` func of fieldMask.
@@ -317,6 +325,10 @@ final class Test_FieldMask: XCTestCase, PBTestHelpers {
317
325
let m7 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
318
326
let m8 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " b " ] )
319
327
XCTAssertEqual ( m7. subtract ( m8) . paths, [ ] )
328
+
329
+ let m9 = Google_Protobuf_FieldMask ( protoPaths: [ " a " , " a " ] )
330
+ let m10 = Google_Protobuf_FieldMask ( protoPaths: [ " b " ] )
331
+ XCTAssertEqual ( m9. subtract ( m10) . paths, [ " a " ] )
320
332
}
321
333
322
334
}
0 commit comments