Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: lib/src/backend/platform_selector.dart

Issue 1036943002: Add a testOn parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/backend/metadata.dart ('k') | lib/src/backend/suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() => "*";
}
« no previous file with comments | « lib/src/backend/metadata.dart ('k') | lib/src/backend/suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698