| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 test('parses a stack frame without column correctly', () { | 23 test('parses a stack frame without column correctly', () { |
| 24 var frame = new Frame.parseVM("#1 Foo._bar " | 24 var frame = new Frame.parseVM("#1 Foo._bar " |
| 25 "(file:///home/nweiz/code/stuff.dart:24)"); | 25 "(file:///home/nweiz/code/stuff.dart:24)"); |
| 26 expect(frame.uri, | 26 expect(frame.uri, |
| 27 equals(Uri.parse("file:///home/nweiz/code/stuff.dart"))); | 27 equals(Uri.parse("file:///home/nweiz/code/stuff.dart"))); |
| 28 expect(frame.line, equals(24)); | 28 expect(frame.line, equals(24)); |
| 29 expect(frame.column, null); | 29 expect(frame.column, null); |
| 30 expect(frame.member, equals('Foo._bar')); | 30 expect(frame.member, equals('Foo._bar')); |
| 31 }); | 31 }); |
| 32 | 32 |
| 33 test('parses a stack frame with timer_impl correctly', () { |
| 34 var frame = new Frame.parseVM("#1 Foo._bar " |
| 35 "(timer_impl.dart:24)"); |
| 36 expect(frame.uri, equals(Uri.parse("dart:async/timer_impl.dart"))); |
| 37 expect(frame.line, equals(24)); |
| 38 expect(frame.column, null); |
| 39 expect(frame.member, equals('Foo._bar')); |
| 40 }); |
| 41 |
| 33 test('converts "<anonymous closure>" to "<fn>"', () { | 42 test('converts "<anonymous closure>" to "<fn>"', () { |
| 34 String parsedMember(String member) => | 43 String parsedMember(String member) => |
| 35 new Frame.parseVM('#0 $member (foo:0:0)').member; | 44 new Frame.parseVM('#0 $member (foo:0:0)').member; |
| 36 | 45 |
| 37 expect(parsedMember('Foo.<anonymous closure>'), equals('Foo.<fn>')); | 46 expect(parsedMember('Foo.<anonymous closure>'), equals('Foo.<fn>')); |
| 38 expect(parsedMember('<anonymous closure>.<anonymous closure>.bar'), | 47 expect(parsedMember('<anonymous closure>.<anonymous closure>.bar'), |
| 39 equals('<fn>.<fn>.bar')); | 48 equals('<fn>.<fn>.bar')); |
| 40 }); | 49 }); |
| 41 | 50 |
| 42 test('parses a folded frame correctly', () { | 51 test('parses a folded frame correctly', () { |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 '(dart:core/uri.dart:5:10)').toString(), | 490 '(dart:core/uri.dart:5:10)').toString(), |
| 482 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); | 491 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); |
| 483 }); | 492 }); |
| 484 | 493 |
| 485 test('prints a frame without a column correctly', () { | 494 test('prints a frame without a column correctly', () { |
| 486 expect(new Frame.parseVM('#0 Foo (dart:core/uri.dart:5)').toString(), | 495 expect(new Frame.parseVM('#0 Foo (dart:core/uri.dart:5)').toString(), |
| 487 equals('dart:core/uri.dart 5 in Foo')); | 496 equals('dart:core/uri.dart 5 in Foo')); |
| 488 }); | 497 }); |
| 489 }); | 498 }); |
| 490 } | 499 } |
| OLD | NEW |