Skip to content

Commit 6788afc

Browse files
author
Clement Skau
authored
[Test] Fixes chain/vm_test on ending async gaps. (flutter#99)
1 parent dd8c2f1 commit 6788afc

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.10.0-nullsafety.7-dev
22

3+
* Fix broken test, `test/chain/vm_test.dart`, which incorrectly handles
4+
asynchronous suspension gap markers at the end of stack traces.
5+
36
## 1.10.0-nullsafety.6
47

58
* Fix bug parsing asynchronous suspension gap markers at the end of stack

test/chain/vm_test.dart

+7-3
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,13 @@ void main() {
492492
}
493493
});
494494

495-
var chain = Chain.forTrace(trace);
496-
expect(chain.traces,
497-
hasLength(vmChainGap.allMatches(trace.toString()).length + 1));
495+
final chain = Chain.forTrace(trace);
496+
final traceStr = trace.toString();
497+
final gaps = vmChainGap.allMatches(traceStr);
498+
// If the trace ends on a gap, there's no sub-trace following the gap.
499+
final expectedLength =
500+
(gaps.last.end == traceStr.length) ? gaps.length : gaps.length + 1;
501+
expect(chain.traces, hasLength(expectedLength));
498502
expect(
499503
chain.traces.first.frames, contains(frameMember(startsWith('main'))));
500504
});

0 commit comments

Comments
 (0)