Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: test/chain/chain_test.dart

Issue 1492323004: Fix a crash in Chain.terse and Chain.foldFrames. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/chain/chain_test.dart
diff --git a/test/chain/chain_test.dart b/test/chain/chain_test.dart
index 0eb3f008723608be3c777c15730504f14dcc79be..cddb4a623acb86e86911365714e403895d3cd9f4 100644
--- a/test/chain/chain_test.dart
+++ b/test/chain/chain_test.dart
@@ -109,6 +109,20 @@ void main() {
expect(chain.terse.toString(), equals('dart:core E.f\n'));
});
+
+ // Regression test for #9
+ test("doesn't crash on empty traces", () {
+ var chain = new Chain([
+ new Trace.parse('user/code.dart 10:11 Bang.qux'),
+ new Trace([]),
+ new Trace.parse('user/code.dart 10:11 Bang.qux')
+ ]);
+
+ expect(chain.terse.toString(), equals(
+ '$userSlashCode 10:11 Bang.qux\n'
+ '===== asynchronous gap ===========================\n'
+ '$userSlashCode 10:11 Bang.qux\n'));
+ });
});
group('Chain.foldFrames', () {
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698