merge method

Merges this with other.

For most fields, if both configurations have values set, other's value takes precedence. However, certain fields are merged together instead. This is indicated in those fields' documentation.

Implementation

SuiteConfiguration merge(SuiteConfiguration other) {
  if (this == SuiteConfiguration.empty) return other;
  if (other == SuiteConfiguration.empty) return this;
  assert(testSelections.isEmpty || other.testSelections.isEmpty);

  var config = SuiteConfiguration._(
      allowDuplicateTestNames:
          other._allowDuplicateTestNames ?? _allowDuplicateTestNames,
      allowTestRandomization:
          other._allowTestRandomization ?? _allowTestRandomization,
      jsTrace: other._jsTrace ?? _jsTrace,
      runSkipped: other._runSkipped ?? _runSkipped,
      dart2jsArgs: dart2jsArgs.toList()..addAll(other.dart2jsArgs),
      testSelections:
          testSelections.isEmpty ? other.testSelections : testSelections,
      precompiledPath: other.precompiledPath ?? precompiledPath,
      compilerSelections: other.compilerSelections ?? compilerSelections,
      runtimes: other._runtimes ?? _runtimes,
      tags: _mergeConfigMaps(tags, other.tags),
      onPlatform: _mergeConfigMaps(onPlatform, other.onPlatform),
      ignoreTimeouts: other._ignoreTimeouts ?? _ignoreTimeouts,
      metadata: metadata.merge(other.metadata));
  return config._resolveTags();
}