| 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 stack_trace.test.utils; | |
| 6 | |
| 7 import 'package:test/test.dart'; | 5 import 'package:test/test.dart'; |
| 8 | 6 |
| 9 /// Returns a matcher that runs [matcher] against a [Frame]'s `member` field. | 7 /// Returns a matcher that runs [matcher] against a [Frame]'s `member` field. |
| 10 Matcher frameMember(matcher) => | 8 Matcher frameMember(matcher) => |
| 11 transform((frame) => frame.member, matcher, 'member'); | 9 transform((frame) => frame.member, matcher, 'member'); |
| 12 | 10 |
| 13 /// Returns a matcher that runs [matcher] against a [Frame]'s `library` field. | 11 /// Returns a matcher that runs [matcher] against a [Frame]'s `library` field. |
| 14 Matcher frameLibrary(matcher) => | 12 Matcher frameLibrary(matcher) => |
| 15 transform((frame) => frame.library, matcher, 'library'); | 13 transform((frame) => frame.library, matcher, 'library'); |
| 16 | 14 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 28 final String _description; | 26 final String _description; |
| 29 | 27 |
| 30 _TransformMatcher(this._transformation, this._matcher, this._description); | 28 _TransformMatcher(this._transformation, this._matcher, this._description); |
| 31 | 29 |
| 32 bool matches(item, Map matchState) => | 30 bool matches(item, Map matchState) => |
| 33 _matcher.matches(_transformation(item), matchState); | 31 _matcher.matches(_transformation(item), matchState); |
| 34 | 32 |
| 35 Description describe(Description description) => | 33 Description describe(Description description) => |
| 36 description.add(_description).add(' ').addDescriptionOf(_matcher); | 34 description.add(_description).add(' ').addDescriptionOf(_matcher); |
| 37 } | 35 } |
| OLD | NEW |