anchor.diff:              ? minExpected
               : maxExpected,
           this.isDone = isDone,
  -        this.testCase = currentTestCase,
  +        testNum = _currentTestCaseIndex,
           this.id = _makeCallbackId(id, callback) {
  -    if(testCase == null) {
  -      throw new StateError("No valid test, did you forget to run your test "
  -          "inside a call to test()?");
  -    }
  -
  +    ensureInitialized();
  +    if (!(_currentTestCaseIndex >= 0 &&
  +           _currentTestCaseIndex < testCases.length &&
  +           testCases[_currentTestCaseIndex] != null)) {
  +      print("No valid test, did you forget to run your test inside a call "
  +          "to test()?");
  +    }
  +    assert(_currentTestCaseIndex >= 0 &&
  +           _currentTestCaseIndex < testCases.length &&
  +           testCases[_currentTestCaseIndex] != null);
  +    testCase = testCases[_currentTestCaseIndex];
       if (isDone != null || minExpected > 0) {
         testCase._callbackFunctionsOutstanding++;
         complete = false;
  
positive.code: /** Runs all queued tests, one at a time. */
  void runTests() {
    _ensureInitialized(false);
    assert(_currentTestCase == null);
  
    _currentGroup = '';
  
    // If we are soloing a test, remove all the others.
  
negative.code: // TODO(sigmund): deprecate this API when issue 2706 is fixed.
  Function expectAsyncUntil2(Function callback, Function isDone, {String id}) {
    return new _SpreadArgsHelper(callback, 0, -1, isDone, id).invoke2;
  }
  
  /**
   * Wraps the [callback] in a new function and returns that function. The new
   * function will be able to handle exceptions by directing them to the correct
   * test. This is thus similar to expectAsync0. Use it to wrap any callbacks that
   * might optionally be called but may never be called during the test.
   * [callback] should take between 0 and 4 positional arguments (named arguments
   * are not supported). [id] can be used to identify the callback in error
   * messages (for example if it is called after the test case is complete).
   */
  Function _protectAsync(Function callback, {String id}) {
    return new _SpreadArgsHelper(callback, 0, -1, null, id).invoke;
  }
  
  /**
  