| Index: pkg/unittest/lib/unittest.dart
|
| ===================================================================
|
| --- pkg/unittest/lib/unittest.dart (revision 0)
|
| +++ pkg/unittest/lib/unittest.dart (working copy)
|
| @@ -11,10 +11,10 @@
|
| * dependencies:
|
| * unittest:
|
| * sdk: unittest
|
| - *
|
| + *
|
| * Then run 'pub install' from your project directory or using
|
| * the DartEditor.
|
| - *
|
| + *
|
| * Please see [Pub Getting Started](http://pub.dartlang.org/doc)
|
| * for more details about the pub package manager.
|
| *
|
| @@ -148,21 +148,11 @@
|
| library unittest;
|
|
|
| import 'dart:isolate';
|
| +import 'matcher.dart';
|
| +export 'matcher.dart';
|
|
|
| -part 'collection_matchers.dart';
|
| -part 'config.dart';
|
| -part 'core_matchers.dart';
|
| -part 'description.dart';
|
| -part 'expect.dart';
|
| -part 'future_matchers.dart';
|
| -part 'interfaces.dart';
|
| -part 'map_matchers.dart';
|
| -part 'matcher.dart';
|
| -part 'mock.dart';
|
| -part 'numeric_matchers.dart';
|
| -part 'operator_matchers.dart';
|
| -part 'string_matchers.dart';
|
| -part 'test_case.dart';
|
| +part 'src/config.dart';
|
| +part 'src/test_case.dart';
|
|
|
| /** [Configuration] used by the unittest library. */
|
| Configuration _config = null;
|
| @@ -377,7 +367,7 @@
|
|
|
| _after() {
|
| if (_isDone()) {
|
| - _handleCallbackFunctionComplete();
|
| + _handleCallbackFunctionComplete(_testNum);
|
| }
|
| }
|
|
|
| @@ -646,7 +636,7 @@
|
| * Called when one of the callback functions is done with all expected
|
| * calls.
|
| */
|
| -void _handleCallbackFunctionComplete() {
|
| +void _handleCallbackFunctionComplete(testNum) {
|
| // TODO (gram): we defer this to give the nextBatch recursive
|
| // stack a chance to unwind. This is a temporary hack but
|
| // really a bunch of code here needs to be fixed. We have a
|
| @@ -654,6 +644,12 @@
|
| // which is recursively invoked in the case of async tests that
|
| // run synchronously. Bad things can then happen.
|
| _defer(() {
|
| + if (_currentTest != testNum) {
|
| + if (_tests[testNum].result == PASS) {
|
| + _tests[testNum].error("Unexpected extra callbacks", '');
|
| + }
|
| + return; // Extraneous callback.
|
| + }
|
| if (_currentTest < _tests.length) {
|
| final testCase = _tests[_currentTest];
|
| --testCase.callbackFunctionsOutstanding;
|
| @@ -683,7 +679,7 @@
|
| * TODO(gram) remove this when WebKit tests are working with new framework
|
| */
|
| void callbackDone() {
|
| - _handleCallbackFunctionComplete();
|
| + _handleCallbackFunctionComplete(_currentTest);
|
| }
|
|
|
| /**
|
| @@ -854,6 +850,8 @@
|
| return;
|
| }
|
| _initialized = true;
|
| + // Hook our async guard into the matcher library.
|
| + wrapAsync = expectAsync1;
|
|
|
| _tests = <TestCase>[];
|
| _testRunner = _nextBatch;
|
|
|