[tool] Fix stdin.flush
calls on processes started by FakeProcessManager
(#151183)
Fixes https://github.com/flutter/flutter/issues/151151
This commit is contained in:
parent
4cb6d38492
commit
8acf86d995
@ -174,6 +174,13 @@ void main() {
|
||||
expect(stderr, 'stderr'.codeUnits);
|
||||
expect(stdout, 'stdout'.codeUnits);
|
||||
});
|
||||
|
||||
testWithoutContext('stdin should be flushable (all data written is consumed)', () async {
|
||||
final FakeProcess process = FakeProcess();
|
||||
process.stdin.write('hello');
|
||||
// If nothing is listening to the stdin stream, this test will never complete.
|
||||
await process.stdin.flush();
|
||||
});
|
||||
});
|
||||
|
||||
group(FakeProcessManager, () {
|
||||
|
@ -160,8 +160,13 @@ class FakeProcess implements io.Process {
|
||||
}
|
||||
return exitCode;
|
||||
}),
|
||||
_stderr = stderr,
|
||||
stdin = stdin ?? IOSink(StreamController<List<int>>().sink),
|
||||
_stderr = stderr,
|
||||
stdin = stdin ??
|
||||
IOSink(
|
||||
StreamController<List<int>>()
|
||||
..stream.listen((_) {})
|
||||
..sink,
|
||||
),
|
||||
_stdout = stdout,
|
||||
_completer = completer
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user