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

Unified Diff: test/chain_test.dart

Issue 1171873002: Support parsing empty stack chains. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years, 6 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 | « lib/src/trace.dart ('k') | no next file » | 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 bfe322ce24d3103af54fca47d72114b61fdfc276..0b6f36e388f305ba3f72ef6ce6d19b50cf4a00cd 100644
--- a/test/chain_test.dart
+++ b/test/chain_test.dart
@@ -472,10 +472,28 @@ void main() {
equals(new Trace.from(trace).toString()));
});
- test('Chain.parse() parses a real Chain', () {
- return captureFuture(() => inMicrotask(() => throw 'error')).then((chain) {
- expect(new Chain.parse(chain.toString()).toString(),
- equals(chain.toString()));
+ group('Chain.parse()', () {
+ test('parses a real Chain', () {
+ return captureFuture(() => inMicrotask(() => throw 'error'))
+ .then((chain) {
+ expect(new Chain.parse(chain.toString()).toString(),
+ equals(chain.toString()));
+ });
+ });
+
+ test('parses an empty string', () {
+ var chain = new Chain.parse('');
+ expect(chain.traces, isEmpty);
+ });
+
+ test('parses a chain containing empty traces', () {
+ var chain = new Chain.parse(
+ '===== asynchronous gap ===========================\n'
+ '===== asynchronous gap ===========================\n');
+ expect(chain.traces, hasLength(3));
+ expect(chain.traces[0].frames, isEmpty);
+ expect(chain.traces[1].frames, isEmpty);
+ expect(chain.traces[2].frames, isEmpty);
});
});
« no previous file with comments | « lib/src/trace.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698