Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 expect(frame.line, isNull); | 37 expect(frame.line, isNull); |
| 38 expect(frame.column, isNull); | 38 expect(frame.column, isNull); |
| 39 }); | 39 }); |
| 40 | 40 |
| 41 test('throws a FormatException for malformed frames', () { | 41 test('throws a FormatException for malformed frames', () { |
| 42 expect(() => new Frame.parseVM(''), throwsFormatException); | 42 expect(() => new Frame.parseVM(''), throwsFormatException); |
| 43 expect(() => new Frame.parseVM('#1'), throwsFormatException); | 43 expect(() => new Frame.parseVM('#1'), throwsFormatException); |
| 44 expect(() => new Frame.parseVM('#1 Foo'), throwsFormatException); | 44 expect(() => new Frame.parseVM('#1 Foo'), throwsFormatException); |
| 45 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart)'), | 45 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart)'), |
| 46 throwsFormatException); | 46 throwsFormatException); |
| 47 expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart:10)'), | |
| 48 throwsFormatException); | |
| 49 expect(() => new Frame.parseVM('#1 (dart:async/future.dart:10:15)'), | 47 expect(() => new Frame.parseVM('#1 (dart:async/future.dart:10:15)'), |
| 50 throwsFormatException); | 48 throwsFormatException); |
| 51 expect(() => new Frame.parseVM('Foo (dart:async/future.dart:10:15)'), | 49 expect(() => new Frame.parseVM('Foo (dart:async/future.dart:10:15)'), |
| 52 throwsFormatException); | 50 throwsFormatException); |
| 53 }); | 51 }); |
|
nweiz
2013/09/24 20:16:03
Add a test that validates the new format that is n
Ivan Posva
2013/09/24 20:55:11
Done.
| |
| 54 }); | 52 }); |
| 55 | 53 |
| 56 group('.parseV8', () { | 54 group('.parseV8', () { |
| 57 test('parses a stack frame correctly', () { | 55 test('parses a stack frame correctly', () { |
| 58 var frame = new Frame.parseV8(" at VW.call\$0 " | 56 var frame = new Frame.parseV8(" at VW.call\$0 " |
| 59 "(http://pub.dartlang.org/stuff.dart.js:560:28)"); | 57 "(http://pub.dartlang.org/stuff.dart.js:560:28)"); |
| 60 expect(frame.uri, | 58 expect(frame.uri, |
| 61 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); | 59 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); |
| 62 expect(frame.line, equals(560)); | 60 expect(frame.line, equals(560)); |
| 63 expect(frame.column, equals(28)); | 61 expect(frame.column, equals(28)); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 equals('http://dartlang.org/thing.dart 5:10 in Foo')); | 306 equals('http://dartlang.org/thing.dart 5:10 in Foo')); |
| 309 }); | 307 }); |
| 310 | 308 |
| 311 test('converts "<anonymous closure>" to "<fn>"', () { | 309 test('converts "<anonymous closure>" to "<fn>"', () { |
| 312 expect(new Frame.parseVM('#0 Foo.<anonymous closure> ' | 310 expect(new Frame.parseVM('#0 Foo.<anonymous closure> ' |
| 313 '(dart:core/uri.dart:5:10)').toString(), | 311 '(dart:core/uri.dart:5:10)').toString(), |
| 314 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); | 312 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); |
| 315 }); | 313 }); |
| 316 }); | 314 }); |
| 317 } | 315 } |
| OLD | NEW |