| 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 trace_test; | 5 library trace_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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 '\tat http://pub.dartlang.org/stuff.js:0:2\n' | 100 '\tat http://pub.dartlang.org/stuff.js:0:2\n' |
| 101 '\tat zip.<anonymous>.zap ' | 101 '\tat zip.<anonymous>.zap ' |
| 102 '(http://pub.dartlang.org/thing.js:1:100)'); | 102 '(http://pub.dartlang.org/thing.js:1:100)'); |
| 103 | 103 |
| 104 expect(trace.frames[0].uri, | 104 expect(trace.frames[0].uri, |
| 105 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); | 105 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); |
| 106 expect(trace.frames[1].uri, | 106 expect(trace.frames[1].uri, |
| 107 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); | 107 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); |
| 108 expect(trace.frames[2].uri, | 108 expect(trace.frames[2].uri, |
| 109 equals(Uri.parse("http://pub.dartlang.org/thing.js"))); | 109 equals(Uri.parse("http://pub.dartlang.org/thing.js"))); |
| 110 |
| 111 trace = new Trace.parse( |
| 112 '\tat Foo._bar (http://pub.dartlang.org/stuff.js:42:21)\n' |
| 113 '\tat \n' |
| 114 '\tat zip.<anonymous>.zap ' |
| 115 '(http://pub.dartlang.org/thing.js:1:100)'); |
| 116 |
| 117 expect(trace.frames[0].uri, |
| 118 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); |
| 119 expect(trace.frames[1].uri, |
| 120 equals(Uri.parse("http://pub.dartlang.org/thing.js"))); |
| 110 }); | 121 }); |
| 111 | 122 |
| 112 test('parses a Firefox/Safari stack trace correctly', () { | 123 test('parses a Firefox/Safari stack trace correctly', () { |
| 113 var trace = new Trace.parse( | 124 var trace = new Trace.parse( |
| 114 'Foo._bar@http://pub.dartlang.org/stuff.js:42\n' | 125 'Foo._bar@http://pub.dartlang.org/stuff.js:42\n' |
| 115 'zip/<@http://pub.dartlang.org/stuff.js:0\n' | 126 'zip/<@http://pub.dartlang.org/stuff.js:0\n' |
| 116 'zip.zap(12, "@)()/<")@http://pub.dartlang.org/thing.js:1'); | 127 'zip.zap(12, "@)()/<")@http://pub.dartlang.org/thing.js:1'); |
| 117 | 128 |
| 118 expect(trace.frames[0].uri, | 129 expect(trace.frames[0].uri, |
| 119 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); | 130 equals(Uri.parse("http://pub.dartlang.org/stuff.js"))); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), | 401 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), |
| 391 terse: true); | 402 terse: true); |
| 392 expect(folded.toString(), equals(''' | 403 expect(folded.toString(), equals(''' |
| 393 foo.dart 42:21 notFoo | 404 foo.dart 42:21 notFoo |
| 394 package:foo fooBottom | 405 package:foo fooBottom |
| 395 bar.dart 10:20 alsoNotFoo | 406 bar.dart 10:20 alsoNotFoo |
| 396 foo fooBottom | 407 foo fooBottom |
| 397 ''')); | 408 ''')); |
| 398 }); | 409 }); |
| 399 } | 410 } |
| OLD | NEW |