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

Unified Diff: test/chain_test.dart

Issue 917423002: Add a "terse" argument to foldFrames(). (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Code review changes Created 5 years, 10 months 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') | test/trace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/chain_test.dart
diff --git a/test/chain_test.dart b/test/chain_test.dart
index 6af3c6b13d7ed2ce9f521016b699680d3922ab9f..54bc5f59eb9020b64e102d59e4580e160ba8ebdb 100644
--- a/test/chain_test.dart
+++ b/test/chain_test.dart
@@ -572,6 +572,33 @@ void main() {
'b.dart 10:11 Zop.zoop\n'));
});
+ test('with terse: true, folds core frames as well', () {
+ var chain = new Chain([
+ new Trace.parse(
+ 'a.dart 10:11 Foo.bar\n'
+ 'dart:async-patch/future.dart 10:11 Zip.zap\n'
+ 'b.dart 10:11 Bang.qux\n'
+ 'dart:core 10:11 Bar.baz\n'
+ 'a.dart 10:11 Zop.zoop'),
+ new Trace.parse(
+ 'a.dart 10:11 Foo.bar\n'
+ 'a.dart 10:11 Bar.baz\n'
+ 'a.dart 10:11 Bang.qux\n'
+ 'a.dart 10:11 Zip.zap\n'
+ 'b.dart 10:11 Zop.zoop')
+ ]);
+
+ var folded = chain.foldFrames((frame) => frame.library == 'a.dart',
+ terse: true);
+ expect(folded.toString(), equals(
+ 'dart:async Zip.zap\n'
+ 'b.dart 10:11 Bang.qux\n'
+ 'a.dart 10:11 Zop.zoop\n'
+ '===== asynchronous gap ===========================\n'
+ 'a.dart 10:11 Zip.zap\n'
+ 'b.dart 10:11 Zop.zoop\n'));
+ });
+
test('eliminates completely-folded traces', () {
var chain = new Chain([
new Trace.parse(
« no previous file with comments | « pubspec.yaml ('k') | test/trace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698