Commit 22e8d85d authored by Hans Muller's avatar Hans Muller

Enhance Finder toString() (#3458)

* Enhance Finder toString()
parent 11f236ec
......@@ -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
......
......@@ -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"]'));
});
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment