| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart'; | 5 import 'package:kernel/ast.dart'; |
| 6 | 6 |
| 7 /// Interface providing the ability to record property/value pairs associated | 7 /// Interface providing the ability to record property/value pairs associated |
| 8 /// with source file locations. Intended to facilitate testing. | 8 /// with source file locations. Intended to facilitate testing. |
| 9 abstract class Instrumentation { | 9 abstract class Instrumentation { |
| 10 /// Records a property/value pair associated with the given URI and offset. | 10 /// Records a property/value pair associated with the given URI and offset. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 /// Instance of [InstrumentationValue] describing a [DartType]. | 29 /// Instance of [InstrumentationValue] describing a [DartType]. |
| 30 class InstrumentationValueForType extends InstrumentationValue { | 30 class InstrumentationValueForType extends InstrumentationValue { |
| 31 final DartType type; | 31 final DartType type; |
| 32 | 32 |
| 33 InstrumentationValueForType(this.type); | 33 InstrumentationValueForType(this.type); |
| 34 | 34 |
| 35 @override | 35 @override |
| 36 String toString() { | 36 String toString() { |
| 37 // Convert '→' to '->' because '→' doesn't show up in some terminals. | 37 // Convert '→' to '->' because '→' doesn't show up in some terminals. |
| 38 return type.toString().replaceAll('→', '->'); | 38 // Remove prefixes that are used very often in tests. |
| 39 return type |
| 40 .toString() |
| 41 .replaceAll('→', '->') |
| 42 .replaceAll('dart.core::', '') |
| 43 .replaceAll('dart.async::', '') |
| 44 .replaceAll('test::', ''); |
| 39 } | 45 } |
| 40 } | 46 } |
| 41 | 47 |
| 42 /// Instance of [InstrumentationValue] which only matches the given literal | 48 /// Instance of [InstrumentationValue] which only matches the given literal |
| 43 /// string. | 49 /// string. |
| 44 class InstrumentationValueLiteral extends InstrumentationValue { | 50 class InstrumentationValueLiteral extends InstrumentationValue { |
| 45 final String value; | 51 final String value; |
| 46 | 52 |
| 47 const InstrumentationValueLiteral(this.value); | 53 const InstrumentationValueLiteral(this.value); |
| 48 | 54 |
| 49 @override | 55 @override |
| 50 String toString() => value; | 56 String toString() => value; |
| 51 } | 57 } |
| OLD | NEW |