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

Unified Diff: lib/src/runner.dart

Issue 1405633004: feature: tag tests; choose tags on command line Base URL: git@github.com:yjbanov/test.git@tags
Patch Set: Created 5 years, 2 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
Index: lib/src/runner.dart
diff --git a/lib/src/runner.dart b/lib/src/runner.dart
index e5831e58a8d29d6d44921f6ec68b54ea8f9253df..260c3106951badc31a575aaecf285d2af02b05eb 100644
--- a/lib/src/runner.dart
+++ b/lib/src/runner.dart
@@ -158,8 +158,9 @@ class Runner {
]);
})).map((loadSuite) {
return loadSuite.changeSuite((suite) {
- if (_config.pattern == null) return suite;
- return suite.filter((test) => test.name.contains(_config.pattern));
+ return suite.filter((test) =>
+ (_config.pattern == null || test.name.contains(_config.pattern)) &&
+ (_config.tags.isEmpty || intersect(_config.tags, test.metadata.tags)));
});
});
}

Powered by Google App Engine
This is Rietveld 408576698