flutter/packages/flutter_test/test/stack_manipulation_test.dart
Phil Quitslund a002e72022 Bump to test 0.12.20. (#8349)
* Bump to test `0.12.20`.

Some test `0.12.20` highlights:
  * introduces `expectLater()`  that returns a `Future` that completes when the matcher has finished running
  * deprecates the `verbose` parameter to `expect()` and the `formatFailure()` (to be removed in `0.13.0`)

Otherwise:
  * to keep up w/ the deprecation of `verbose`, removes `widget_tester` API to pass `verbose` flag (alternatively we could suppress the warning for now)

* Update stack manipulation.

* Fix framecount.
2017-02-23 15:08:25 -08:00

29 lines
957 B
Dart

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_test/flutter_test.dart';
void main() {
test('stack manipulation: reportExpectCall', () {
try {
expect(false, isTrue);
throw 'unexpectedly did not throw';
} catch (e, stack) {
StringBuffer information = new StringBuffer();
expect(reportExpectCall(stack, information), 4);
List<String> lines = information.toString().split('\n');
expect(lines[0], 'This was caught by the test expectation on the following line:');
expect(lines[1], matches(r'^ .*stack_manipulation_test.dart line [0-9]+$'));
}
try {
throw null;
} catch (e, stack) {
StringBuffer information = new StringBuffer();
expect(reportExpectCall(stack, information), 0);
expect(information.toString(), '');
}
});
}