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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 '''); | 352 '''); |
353 | 353 |
354 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), | 354 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), |
355 terse: true); | 355 terse: true); |
356 expect(folded.toString(), equals(''' | 356 expect(folded.toString(), equals(''' |
357 foo.dart 42:21 notFoo | 357 foo.dart 42:21 notFoo |
358 dart:async coreBottom | 358 dart:async coreBottom |
359 bar.dart 10:20 alsoNotFoo | 359 bar.dart 10:20 alsoNotFoo |
360 ''')); | 360 ''')); |
361 }); | 361 }); |
| 362 |
| 363 test('.foldFrames with terse: true shortens folded frames', () { |
| 364 var trace = new Trace.parse(''' |
| 365 #0 notFoo (foo.dart:42:21) |
| 366 #1 fooTop (bar.dart:0:2) |
| 367 #2 fooBottom (package:foo/bar.dart:0:2) |
| 368 #3 alsoNotFoo (bar.dart:10:20) |
| 369 #4 fooTop (foo.dart:9:11) |
| 370 #5 fooBottom (foo/bar.dart:9:11) |
| 371 '''); |
| 372 |
| 373 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo'), |
| 374 terse: true); |
| 375 expect(folded.toString(), equals(''' |
| 376 foo.dart 42:21 notFoo |
| 377 package:foo fooBottom |
| 378 bar.dart 10:20 alsoNotFoo |
| 379 foo fooBottom |
| 380 ''')); |
| 381 }); |
362 } | 382 } |
OLD | NEW |