-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Remove mocks from compile_expression_test #78092
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
Conversation
writes.clear(); | ||
} | ||
|
||
String getAndClear() { |
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.
Adopted from
flutter/packages/flutter_tools/test/src/mocks.dart
Lines 220 to 224 in 807bb29
String getAndClear() { | |
final String result = stdInWrites.toString(); | |
stdInWrites.clear(); | |
return result; | |
} |
I could be convinced that the clear
method is unnecessary, but getting the string is convenient.
stdErrStreamController = StreamController<String>(); | ||
when(mockFrontendServerStdErr.transform<String>(any)) | ||
.thenAnswer((Invocation invocation) => stdErrStreamController.stream); |
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.
This extra MockStream
redirection was unnecessary, directly look up mockFrontendServer.stderr
to the stdErrStreamController
StreamController
.
This pull request is not suitable for automatic merging in its current state.
|
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
In
compile_expression_test
replaceMockStdIn
withMemoryIOSink
. Add convenience methods onMemoryIOSink
to easily get and clear the string written to stdin, and adopt the new methods in a few places.Part of #71511