Unverified Commit 17de0c53 authored by Martin Kustermann's avatar Martin Kustermann Committed by GitHub

Weaken stack-trace based tests to allow auto-roll of new engine which will...

Weaken stack-trace based tests to allow auto-roll of new engine which will change the format (#51047)

Follow-up PR will restore those tests with new expectations:
https://github.com/flutter/flutter/pull/50760
parent d8a21697
......@@ -81,11 +81,6 @@ Future<void> main() async {
r'#2 getSampleStack \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#3 main \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
r'\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\)\n'
r'\n'
r'line 1 of extra information\n'
r'line 2 of extra information\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
......@@ -153,11 +148,6 @@ Future<void> main() async {
r'#2 getSampleStack \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#3 main \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
r'\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\)\n'
r'\n'
r'line 1 of extra information\n'
r'line 2 of extra information\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
......
......@@ -16,13 +16,11 @@ void main() {
expect(filtered[0], matches(r'^#0 +main\.<anonymous closure> \(.*stack_trace_test\.dart:[0-9]+:[0-9]+\)$'));
expect(filtered[1], matches(r'^#1 +Declarer\.test\.<anonymous closure>.<anonymous closure>.<anonymous closure> \(package:test_api/.+:[0-9]+:[0-9]+\)$'));
expect(filtered[2], equals('<asynchronous suspension>'));
expect(filtered.last, matches(r'^\(elided [1-9][0-9]+ frames from class _RawReceivePortImpl, class _Timer, dart:async(, dart:async-patch,)? and package:stack_trace\)$'));
});
test('FlutterError.defaultStackFilter (async test body)', () async {
final List<String> filtered = FlutterError.defaultStackFilter(StackTrace.current.toString().trimRight().split('\n')).toList();
expect(filtered.length, greaterThanOrEqualTo(3));
expect(filtered[0], matches(r'^#0 +main\.<anonymous closure> \(.*stack_trace_test\.dart:[0-9]+:[0-9]+\)$'));
expect(filtered.last, matches(r'^\(elided [1-9][0-9]+ frames from class _RawReceivePortImpl, class _Timer, dart:async(, dart:async-patch,)? and package:stack_trace\)$'));
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment