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

Side by Side Diff: pkg/stack_trace/test/frame_test.dart

Issue 23133004: Support "..." VM frames in pkg/stack_trace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/stack_trace/lib/src/trace.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library frame_test; 5 library frame_test;
6 6
7 import 'package:path/path.dart' as path; 7 import 'package:path/path.dart' as path;
8 import 'package:stack_trace/stack_trace.dart'; 8 import 'package:stack_trace/stack_trace.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 11 matching lines...) Expand all
22 22
23 test('converts "<anonymous closure>" to "<fn>"', () { 23 test('converts "<anonymous closure>" to "<fn>"', () {
24 String parsedMember(String member) => 24 String parsedMember(String member) =>
25 new Frame.parseVM('#0 $member (foo:0:0)').member; 25 new Frame.parseVM('#0 $member (foo:0:0)').member;
26 26
27 expect(parsedMember('Foo.<anonymous closure>'), equals('Foo.<fn>')); 27 expect(parsedMember('Foo.<anonymous closure>'), equals('Foo.<fn>'));
28 expect(parsedMember('<anonymous closure>.<anonymous closure>.bar'), 28 expect(parsedMember('<anonymous closure>.<anonymous closure>.bar'),
29 equals('<fn>.<fn>.bar')); 29 equals('<fn>.<fn>.bar'));
30 }); 30 });
31 31
32 test('parses a folded frame correctly', () {
33 var frame = new Frame.parseVM('...');
34
35 expect(frame.member, equals('...'));
36 expect(frame.uri, equals(new Uri()));
37 expect(frame.line, isNull);
38 expect(frame.column, isNull);
39 });
40
32 test('throws a FormatException for malformed frames', () { 41 test('throws a FormatException for malformed frames', () {
33 expect(() => new Frame.parseVM(''), throwsFormatException); 42 expect(() => new Frame.parseVM(''), throwsFormatException);
34 expect(() => new Frame.parseVM('#1'), throwsFormatException); 43 expect(() => new Frame.parseVM('#1'), throwsFormatException);
35 expect(() => new Frame.parseVM('#1 Foo'), throwsFormatException); 44 expect(() => new Frame.parseVM('#1 Foo'), throwsFormatException);
36 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart)'), 45 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart)'),
37 throwsFormatException); 46 throwsFormatException);
38 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart:10)'), 47 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart:10)'),
39 throwsFormatException); 48 throwsFormatException);
40 expect(() => new Frame.parseVM('#1 (dart:async/future.dart:10:15)'), 49 expect(() => new Frame.parseVM('#1 (dart:async/future.dart:10:15)'),
41 throwsFormatException); 50 throwsFormatException);
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 equals('http://dartlang.org/thing.dart 5:10 in Foo')); 296 equals('http://dartlang.org/thing.dart 5:10 in Foo'));
288 }); 297 });
289 298
290 test('converts "<anonymous closure>" to "<fn>"', () { 299 test('converts "<anonymous closure>" to "<fn>"', () {
291 expect(new Frame.parseVM('#0 Foo.<anonymous closure> ' 300 expect(new Frame.parseVM('#0 Foo.<anonymous closure> '
292 '(dart:core/uri.dart:5:10)').toString(), 301 '(dart:core/uri.dart:5:10)').toString(),
293 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); 302 equals('dart:core/uri.dart 5:10 in Foo.<fn>'));
294 }); 303 });
295 }); 304 });
296 } 305 }
OLDNEW
« no previous file with comments | « pkg/stack_trace/lib/src/trace.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698