diff --git a/packages/flutter_test/lib/src/stack_manipulation.dart b/packages/flutter_test/lib/src/stack_manipulation.dart index d4ac0508f9..07bd078d82 100644 --- a/packages/flutter_test/lib/src/stack_manipulation.dart +++ b/packages/flutter_test/lib/src/stack_manipulation.dart @@ -15,7 +15,7 @@ int reportExpectCall(StackTrace stack, StringBuffer information) { final RegExp line0 = new RegExp(r'^#0 +fail \(.+\)$'); final RegExp line1 = new RegExp(r'^#1 +expect \(.+\)$'); final RegExp line2 = new RegExp(r'^#2 +expect \(.+\)$'); - final RegExp line3 = new RegExp(r'^#3 +[^(]+ \((.+):([0-9]+):[0-9]+\)$'); + final RegExp line3 = new RegExp(r'^#3 +[^(]+ \((.+?):([0-9]+)(?::[0-9]+)?\)$'); final List stackLines = stack.toString().split('\n'); if (line0.firstMatch(stackLines[0]) != null && line1.firstMatch(stackLines[1]) != null && diff --git a/packages/flutter_test/test/stack_manipulation_test.dart b/packages/flutter_test/test/stack_manipulation_test.dart index a755fbfb2d..805b180760 100644 --- a/packages/flutter_test/test/stack_manipulation_test.dart +++ b/packages/flutter_test/test/stack_manipulation_test.dart @@ -8,6 +8,7 @@ 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), 3);