mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* 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.
29 lines
957 B
Dart
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(), '');
|
|
}
|
|
});
|
|
}
|