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:pathos/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 |
11 String getStackTraceString() { | 11 String getStackTraceString() { |
12 try { | 12 try { |
13 throw ''; | 13 throw ''; |
14 } catch (_, stackTrace) { | 14 } catch (_, stackTrace) { |
15 return stackTrace.toString(); | 15 return stackTrace.toString(); |
16 } | 16 } |
17 } | 17 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo')); | 183 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo')); |
184 expect(folded.toString(), equals(''' | 184 expect(folded.toString(), equals(''' |
185 foo.dart 42:21 notFoo | 185 foo.dart 42:21 notFoo |
186 foo.dart 1:100 fooBottom | 186 foo.dart 1:100 fooBottom |
187 bar.dart 10:20 alsoNotFoo | 187 bar.dart 10:20 alsoNotFoo |
188 dart:async-patch/future.dart 9:11 fooBottom | 188 dart:async-patch/future.dart 9:11 fooBottom |
189 ''')); | 189 ''')); |
190 }); | 190 }); |
191 } | 191 } |
OLD | NEW |