New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the defaults for textBaseline #68646
Conversation
try { | ||
Table(defaultVerticalAlignment: TableCellVerticalAlignment.baseline); | ||
throw TestFailure('Table should throw when missing necessary baseline information.'); | ||
} on AssertionError catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out how to make throwsA verify the text of the exception. Can you elaborate on what you'd like it to look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use .having
for that:
flutter/packages/flutter/test/foundation/diagnostics_test.dart
Lines 903 to 910 in 2783f8e
expect( | |
() => describeEnum('Hello World'), | |
throwsA(isAssertionError.having( | |
(AssertionError e) => e.message, | |
'message', | |
'The provided object "Hello World" is not an enum.'), | |
), | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
(this is why my ideal test framework has no expect
and no matchers. Just use regular Dart. No need to learn crazy APIs when regular code can do the same thing in fewer lines of code, no shame in not knowing the random test library APIs. :-P)
@Hixie - changes makes sense to me. added a minor suggestion to the test. |
94bd29d
to
bb2023f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We can't know what the correct default is. It depends entirely on the application's locale.
applied suggested fix, will land on green |
This pull request is not suitable for automatic merging in its current state.
|
We can't know what the correct default is. It depends entirely on the application's locale.
cc @tvolkert @ramnavan
Reverts #60586, #61425. See also #58053.