Chromium Code Reviews| Index: lib/test.dart |
| diff --git a/lib/test.dart b/lib/test.dart |
| index 48235ff78e4ced7fd86eda507e2080fd6ef6ebd2..4d19aa0151475da939b017571da2fa00fb1af768 100644 |
| --- a/lib/test.dart |
| +++ b/lib/test.dart |
| @@ -113,9 +113,10 @@ Declarer get _declarer { |
| /// If multiple platforms match, the annotations apply in order as through |
| /// they were in nested groups. |
| void test(String description, body(), {String testOn, Timeout timeout, |
| - skip, Map<String, dynamic> onPlatform}) => |
| - _declarer.test(description, body, |
| - testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform); |
| + skip, Map<String, dynamic> onPlatform, String tag, |
| + List<String> tags}) => _declarer.test(description, body, |
| + testOn: testOn, timeout: timeout, skip: skip, |
| + onPlatform: onPlatform, tags: _deconvenienceTags(tag, tags)); |
| /// Creates a group of tests. |
| /// |
| @@ -157,9 +158,10 @@ void test(String description, body(), {String testOn, Timeout timeout, |
| /// If multiple platforms match, the annotations apply in order as through |
| /// they were in nested groups. |
| void group(String description, void body(), {String testOn, Timeout timeout, |
| - skip, Map<String, dynamic> onPlatform}) => |
| - _declarer.group(description, body, |
| - testOn: testOn, timeout: timeout, skip: skip); |
| + skip, Map<String, dynamic> onPlatform, String tag, |
| + List<String> tags}) => _declarer.group(description, body, |
|
nweiz
2015/10/13 23:28:12
I'd like to just have one dynamic-typed parameter
yjbanov
2015/10/30 20:14:00
Done.
|
| + testOn: testOn, timeout: timeout, skip: skip, |
| + tags: _deconvenienceTags(tag, tags)); |
| /// Registers a function to be run before tests. |
| /// |
| @@ -221,3 +223,13 @@ void registerException(error, [StackTrace stackTrace]) { |
| // going through the zone API allows other zones to consistently see errors. |
| Zone.current.handleUncaughtError(error, stackTrace); |
| } |
| + |
| +List<String> _deconvenienceTags(String tag, List<String> tags) { |
| + var result = const[]; |
| + if (tag != null || (tags != null && tags.isNotEmpty)) { |
| + result = []; |
| + if (tag != null) result.add(tag); |
| + if (tags != null && tags.isNotEmpty) result.addAll(tags); |
| + } |
| + return result; |
| +} |