| 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:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 | 10 |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 #1 top (dart:async/future.dart:0:2) | 345 #1 top (dart:async/future.dart:0:2) |
| 346 #2 bottom (dart:core/uri.dart:1:100) | 346 #2 bottom (dart:core/uri.dart:1:100) |
| 347 '''); | 347 '''); |
| 348 | 348 |
| 349 expect(trace.terse.toString(), equals(''' | 349 expect(trace.terse.toString(), equals(''' |
| 350 dart:core bottom | 350 dart:core bottom |
| 351 ''')); | 351 ''')); |
| 352 }); | 352 }); |
| 353 | 353 |
| 354 test(".terse won't panic on an empty trace", () { | 354 test(".terse won't panic on an empty trace", () { |
| 355 expect(Trace.parse("").terse.toString(), equals("")); | 355 expect(new Trace.parse("").terse.toString(), equals("")); |
| 356 }); | 356 }); |
| 357 | 357 |
| 358 test('.foldFrames folds frames together bottom-up', () { | 358 test('.foldFrames folds frames together bottom-up', () { |
| 359 var trace = new Trace.parse(''' | 359 var trace = new Trace.parse(''' |
| 360 #0 notFoo (foo.dart:42:21) | 360 #0 notFoo (foo.dart:42:21) |
| 361 #1 fooTop (bar.dart:0:2) | 361 #1 fooTop (bar.dart:0:2) |
| 362 #2 fooBottom (foo.dart:1:100) | 362 #2 fooBottom (foo.dart:1:100) |
| 363 #3 alsoNotFoo (bar.dart:10:20) | 363 #3 alsoNotFoo (bar.dart:10:20) |
| 364 #4 fooTop (dart:io/socket.dart:5:10) | 364 #4 fooTop (dart:io/socket.dart:5:10) |
| 365 #5 fooBottom (dart:async-patch/future.dart:9:11) | 365 #5 fooBottom (dart:async-patch/future.dart:9:11) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 '''); | 421 '''); |
| 422 | 422 |
| 423 expect(trace.foldFrames((frame) => true).toString(), equals(r''' | 423 expect(trace.foldFrames((frame) => true).toString(), equals(r''' |
| 424 .g"cs$#:b";a#>sw{*{ul$"$xqwr`p | 424 .g"cs$#:b";a#>sw{*{ul$"$xqwr`p |
| 425 %+j-?uppx<([j@#nu{{>*+$%x-={`{ | 425 %+j-?uppx<([j@#nu{{>*+$%x-={`{ |
| 426 !e($b{nj)zs?cgr%!;bmw.+$j+pfj~ | 426 !e($b{nj)zs?cgr%!;bmw.+$j+pfj~ |
| 427 ''')); | 427 ''')); |
| 428 }); | 428 }); |
| 429 }); | 429 }); |
| 430 } | 430 } |
| OLD | NEW |