| 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:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 test('parses an anonymous stack frame correctly', () { | 142 test('parses an anonymous stack frame correctly', () { |
| 143 var frame = new Frame.parseV8( | 143 var frame = new Frame.parseV8( |
| 144 " at http://pub.dartlang.org/stuff.dart.js:560:28"); | 144 " at http://pub.dartlang.org/stuff.dart.js:560:28"); |
| 145 expect(frame.uri, | 145 expect(frame.uri, |
| 146 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); | 146 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); |
| 147 expect(frame.line, equals(560)); | 147 expect(frame.line, equals(560)); |
| 148 expect(frame.column, equals(28)); | 148 expect(frame.column, equals(28)); |
| 149 expect(frame.member, equals('<fn>')); | 149 expect(frame.member, equals('<fn>')); |
| 150 }); | 150 }); |
| 151 | 151 |
| 152 test('parses a native stack frame correctly', () { |
| 153 var frame = new Frame.parseV8( |
| 154 " at Object.stringify (native)"); |
| 155 expect(frame.uri, Uri.parse('native')); |
| 156 expect(frame.line, isNull); |
| 157 expect(frame.column, isNull); |
| 158 expect(frame.member, equals('Object.stringify')); |
| 159 }); |
| 160 |
| 152 test('parses a stack frame with [as ...] correctly', () { | 161 test('parses a stack frame with [as ...] correctly', () { |
| 153 // Ignore "[as ...]", since other stack trace formats don't support a | 162 // Ignore "[as ...]", since other stack trace formats don't support a |
| 154 // similar construct. | 163 // similar construct. |
| 155 var frame = new Frame.parseV8(" at VW.call\$0 [as call\$4] " | 164 var frame = new Frame.parseV8(" at VW.call\$0 [as call\$4] " |
| 156 "(http://pub.dartlang.org/stuff.dart.js:560:28)"); | 165 "(http://pub.dartlang.org/stuff.dart.js:560:28)"); |
| 157 expect(frame.uri, | 166 expect(frame.uri, |
| 158 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); | 167 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); |
| 159 expect(frame.line, equals(560)); | 168 expect(frame.line, equals(560)); |
| 160 expect(frame.column, equals(28)); | 169 expect(frame.column, equals(28)); |
| 161 expect(frame.member, equals('VW.call\$0')); | 170 expect(frame.member, equals('VW.call\$0')); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 equals('dart:core/uri.dart 5 in Foo')); | 555 equals('dart:core/uri.dart 5 in Foo')); |
| 547 }); | 556 }); |
| 548 | 557 |
| 549 test('prints relative paths as relative', () { | 558 test('prints relative paths as relative', () { |
| 550 var relative = path.normalize('relative/path/to/foo.dart'); | 559 var relative = path.normalize('relative/path/to/foo.dart'); |
| 551 expect(new Frame.parseFriendly('$relative 5:10 Foo').toString(), | 560 expect(new Frame.parseFriendly('$relative 5:10 Foo').toString(), |
| 552 equals('$relative 5:10 in Foo')); | 561 equals('$relative 5:10 in Foo')); |
| 553 }); | 562 }); |
| 554 }); | 563 }); |
| 555 } | 564 } |
| OLD | NEW |