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

Unified Diff: lib/metatest.dart

Issue 1241123003: Support test named arguments. (Closed) Base URL: git@github.com:dart-lang/metatest@master
Patch Set: Created 5 years, 5 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 | « CHANGELOG.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/metatest.dart
diff --git a/lib/metatest.dart b/lib/metatest.dart
index 8eb89012bbd2e4db86567208655da7222f76c1bd..656cc2b65af373b0a63d51652f0df53c47d1a6c8 100644
--- a/lib/metatest.dart
+++ b/lib/metatest.dart
@@ -10,7 +10,6 @@
library metatest;
import 'dart:async';
-import 'dart:isolate';
// TODO(nweiz): Stop importing from src when dart-lang/test#48 is fixed.
import 'package:test/src/backend/declarer.dart';
@@ -25,7 +24,8 @@ import 'package:test/test.dart';
/// [body] corresponds to the `main` method of a test file. By default, this
/// expects that all tests defined in [body] pass, but if [passing] is passed,
/// only tests listed there are expected to pass.
-void expectTestsPass(String description, void body(), {List<String> passing}) {
+void expectTestsPass(String description, void body(), {List<String> passing,
+ String testOn, Timeout timeout, skip, Map<String, dynamic> onPlatform}) {
_setUpTest(description, body, (liveTests) {
if (passing == null) {
if (liveTests.any(
@@ -49,20 +49,23 @@ void expectTestsPass(String description, void body(), {List<String> passing}) {
'${stringify(didPass)} passed.\n'
'${_summarizeTests(liveTests)}');
}
- });
+ }, testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform);
}
/// Asserts that all tests defined by [body] fail.
///
/// [body] corresponds to the `main` method of a test file.
-void expectTestsFail(String description, body()) {
- expectTestsPass(description, body, passing: []);
+void expectTestsFail(String description, body(), {String testOn,
+ Timeout timeout, skip, Map<String, dynamic> onPlatform}) {
+ expectTestsPass(description, body, passing: [], testOn: testOn,
+ timeout: timeout, skip: skip, onPlatform: onPlatform);
}
/// Sets up a test with the given [description] and [body]. After the test runs,
/// calls [validate] with the result map.
void _setUpTest(String description, void body(),
- void validate(List<LiveTest> liveTests)) {
+ void validate(List<LiveTest> liveTests), {String testOn, Timeout timeout,
+ skip, Map<String, dynamic> onPlatform}) {
test(description, () async {
var declarer = new Declarer();
runZoned(body, zoneValues: {#test.declarer: declarer});
@@ -74,7 +77,7 @@ void _setUpTest(String description, void body(),
await engine.run();
validate(engine.liveTests);
- });
+ }, testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform);
}
/// Returns a string description of the test run descibed by [liveTests].
« no previous file with comments | « CHANGELOG.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698