| Index: lib/src/backend/platform_selector.dart
|
| diff --git a/lib/src/backend/platform_selector.dart b/lib/src/backend/platform_selector.dart
|
| index d614dec3f44b2e79b287e734c9b56809057606a2..c8a49c73a351d74eece68a19aa954ba864627337 100644
|
| --- a/lib/src/backend/platform_selector.dart
|
| +++ b/lib/src/backend/platform_selector.dart
|
| @@ -44,6 +44,10 @@ abstract class PlatformSelector {
|
| ///
|
| /// [os] defaults to [OperatingSystem.none].
|
| bool evaluate(TestPlatform platform, {OperatingSystem os});
|
| +
|
| + /// Returns a new [PlatformSelector] that matches only platforms matched by
|
| + /// both [this] and [other].
|
| + PlatformSelector intersect(PlatformSelector other);
|
| }
|
|
|
| /// The concrete implementation of a [PlatformSelector] parsed from a string.
|
| @@ -64,6 +68,12 @@ class _PlatformSelector implements PlatformSelector{
|
| bool evaluate(TestPlatform platform, {OperatingSystem os}) =>
|
| _selector.accept(new Evaluator(platform, os: os));
|
|
|
| + PlatformSelector intersect(PlatformSelector other) {
|
| + if (other == PlatformSelector.all) return this;
|
| + return new _PlatformSelector(new AndNode(
|
| + _selector, (other as _PlatformSelector)._selector));
|
| + }
|
| +
|
| String toString() => _selector.toString();
|
| }
|
|
|
| @@ -73,6 +83,8 @@ class _AllPlatforms implements PlatformSelector {
|
|
|
| bool evaluate(TestPlatform platform, {OperatingSystem os}) => true;
|
|
|
| + PlatformSelector intersect(PlatformSelector other) => other;
|
| +
|
| String toString() => "*";
|
| }
|
|
|
|
|