| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 '''); | 308 '''); |
| 309 | 309 |
| 310 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo')); | 310 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo')); |
| 311 expect(folded.toString(), equals(''' | 311 expect(folded.toString(), equals(''' |
| 312 foo.dart 42:21 notFoo | 312 foo.dart 42:21 notFoo |
| 313 foo.dart 1:100 fooBottom | 313 foo.dart 1:100 fooBottom |
| 314 bar.dart 10:20 alsoNotFoo | 314 bar.dart 10:20 alsoNotFoo |
| 315 dart:async-patch/future.dart 9:11 fooBottom | 315 dart:async-patch/future.dart 9:11 fooBottom |
| 316 ''')); | 316 ''')); |
| 317 }); | 317 }); |
| 318 |
| 319 test('.foldFrames with terse: true, folds core frames as well', () { |
| 320 var trace = new Trace.parse(''' |
| 321 #0 notFoo (foo.dart:42:21) |
| 322 #1 fooTop (bar.dart:0:2) |
| 323 #2 coreBottom (dart:async/future.dart:0:2) |
| 324 #3 alsoNotFoo (bar.dart:10:20) |
| 325 #4 fooTop (foo.dart:9:11) |
| 326 #5 coreBottom (dart:async-patch/future.dart:9:11) |
| 327 '''); |
| 328 |
| 329 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), |
| 330 terse: true); |
| 331 expect(folded.toString(), equals(''' |
| 332 foo.dart 42:21 notFoo |
| 333 dart:async coreBottom |
| 334 bar.dart 10:20 alsoNotFoo |
| 335 dart:async coreBottom |
| 336 ''')); |
| 337 }); |
| 318 } | 338 } |
| OLD | NEW |