Handle stack traces that don't give column numbers (#4016)
This commit is contained in:
parent
dacfdb64cf
commit
ef563c485e
@ -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<String> stackLines = stack.toString().split('\n');
|
||||
if (line0.firstMatch(stackLines[0]) != null &&
|
||||
line1.firstMatch(stackLines[1]) != null &&
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user