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

Unified Diff: pkg/unittest/test/middle_exception_test.dart

Issue 524153002: Sharing metatest logic between unittest and scheduled_test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: CR feedback Created 6 years, 3 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: pkg/unittest/test/middle_exception_test.dart
diff --git a/pkg/unittest/test/middle_exception_test.dart b/pkg/unittest/test/middle_exception_test.dart
index 6fb1b7b8f550fa040158c8a8858073d6760a7e02..62e267f837a1a68dcb2019929ed12fae81e570bd 100644
--- a/pkg/unittest/test/middle_exception_test.dart
+++ b/pkg/unittest/test/middle_exception_test.dart
@@ -2,28 +2,37 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library unittestTest;
-
-import 'dart:async';
-import 'dart:isolate';
+library unittest.middle_exception_test;
+import 'package:metatest/metatest.dart';
import 'package:unittest/unittest.dart';
-part 'utils.dart';
+import 'utils.dart';
+
+void main() => initTests(_test);
-var testName = 'late exception test';
+void _test(message) {
+ initMetatest(message);
-var testFunction = (_) {
- test('testOne', () { expect(true, isTrue); });
- test('testTwo', () { expect(true, isFalse); });
- test('testThree', () {
- var done = expectAsync(() {});
- _defer(() {
+ expectTestResults('late exception test', () {
+ test('testOne', () {
expect(true, isTrue);
- done();
});
- });
-};
-
-final expected = buildStatusString(2, 1, 0,
- 'testOne::testTwo:Expected: false Actual: <true>:testThree');
+ test('testTwo', () {
+ expect(true, isFalse);
+ });
+ test('testThree', () {
+ var done = expectAsync(() {});
+ defer(() {
+ expect(true, isTrue);
+ done();
+ });
+ });
+ }, [{
+ 'result': 'pass'
+ }, {
+ 'result': 'fail',
+ }, {
+ 'result': 'pass'
+ }]);
+}

Powered by Google App Engine
This is Rietveld 408576698