merge method

Metadata merge(
  1. Metadata other
)

Return a new Metadata that merges this with other.

If the two Metadatas have conflicting properties, other wins. If either has a forTag metadata for one of the other's tags, that metadata is merged as well.

Implementation

Metadata merge(Metadata other) => Metadata(
  testOn: testOn.intersection(other.testOn),
  timeout: timeout.merge(other.timeout),
  skip: other._skip ?? _skip,
  skipReason: other.skipReason ?? skipReason,
  verboseTrace: other._verboseTrace ?? _verboseTrace,
  chainStackTraces: other._chainStackTraces ?? _chainStackTraces,
  retry: other._retry ?? _retry,
  tags: tags.union(other.tags),
  onPlatform: mergeMaps(
    onPlatform,
    other.onPlatform,
    value: (metadata1, metadata2) => metadata1.merge(metadata2),
  ),
  forTag: mergeMaps(
    forTag,
    other.forTag,
    value: (metadata1, metadata2) => metadata1.merge(metadata2),
  ),
  languageVersionComment:
      other.languageVersionComment ?? languageVersionComment,
);