Refactor SemanticsData and SemanticsNode to use Diagnosticable. (#11957)
* Refactor SemanticsData and SemanticsNode to use Diagnosticable. * Switch toStringDeep to take named parameters.
This commit is contained in:
@@ -507,7 +507,7 @@ class _HasGoodToStringDeep extends Matcher {
|
||||
final String prefixOtherLines = 'PREFIX_OTHER_LINES_';
|
||||
final List<String> prefixIssues = <String>[];
|
||||
String descriptionWithPrefixes =
|
||||
object.toStringDeep(prefixLineOne, prefixOtherLines);
|
||||
object.toStringDeep(prefixLineOne: prefixLineOne, prefixOtherLines: prefixOtherLines);
|
||||
if (descriptionWithPrefixes.endsWith('\n')) {
|
||||
// Trim off trailing \n as the remaining calculations assume
|
||||
// the description does not end with a trailing \n.
|
||||
@@ -532,7 +532,7 @@ class _HasGoodToStringDeep extends Matcher {
|
||||
|
||||
if (prefixIssues.isNotEmpty) {
|
||||
errorDescription.writeln(
|
||||
'Bad toStringDeep("$prefixLineOne", "$prefixOtherLines"):');
|
||||
'Bad toStringDeep(prefixLineOne: "$prefixLineOne", prefixOtherLines: "$prefixOtherLines"):');
|
||||
errorDescription.writeln(descriptionWithPrefixes);
|
||||
errorDescription.writeAll(prefixIssues, '\n');
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class _MockToStringDeep {
|
||||
/// line break.
|
||||
List<String> _lines;
|
||||
|
||||
String toStringDeep([String prefixLineOne="", String prefixOtherLines=""]) {
|
||||
String toStringDeep({ String prefixLineOne: "", String prefixOtherLines: "" }) {
|
||||
final StringBuffer sb = new StringBuffer();
|
||||
if (_lines.isNotEmpty)
|
||||
sb.write('$prefixLineOne${_lines.first}');
|
||||
|
||||
Reference in New Issue
Block a user