Enhance Finder toString() (#3458)

* Enhance Finder toString()
This commit is contained in:
Hans Muller 2016-04-21 12:13:51 -07:00
parent 11f236ec25
commit 22e8d85d16
2 changed files with 5 additions and 5 deletions

View File

@ -291,7 +291,7 @@ abstract class Finder {
}
@override
String toString() => 'widget with $description';
String toString() => '[Finder for $description]';
}
/// Indicates that an attempt to find a widget within the current element tree

View File

@ -26,9 +26,9 @@ void main() {
expect(failure, isNotNull);
String message = failure.message;
expect(message, contains('Expected: widget with text "foo" exists in the element tree'));
expect(message, contains('Expected: [Finder for text "foo"] exists in the element tree'));
expect(message, contains("Actual: <Instance of 'WidgetTester'>"));
expect(message, contains('Which: Does not contain widget with text "foo"'));
expect(message, contains('Which: Does not contain [Finder for text "foo"]'));
});
});
});
@ -53,9 +53,9 @@ void main() {
expect(failure, isNotNull);
String message = failure.message;
expect(message, contains('Expected: widget with text "foo" does not exist in the element tree'));
expect(message, contains('Expected: [Finder for text "foo"] does not exist in the element tree'));
expect(message, contains("Actual: <Instance of 'WidgetTester'>"));
expect(message, contains('Which: Contains widget with text "foo"'));
expect(message, contains('Which: Contains [Finder for text "foo"]'));
});
});
});