Open
Description
While implementing #91754, we came across a lack of test coverage for Stdin::Read
. The function has two code paths, one of which is triggered when input is piped in, and the other is triggered when the user is calling the executable from the console. This "console mode" code path is, as far as I'm able to tell, entirely ignored by automated tests and the CI.
I was unable to get anything near automated to actually use the console mode. However, manually feeding it inputs is easy, and has been the main method of testing that code path since the path's creation. This is sub-optimal, and should be remedied.
We have a couple approaches that could be attempted, but I seek larger input from the community, since this is not a trivial problem.
- Finding a way to mock the console mode in Windows
- Have a toggleable flag that would allow for the console mode path to be diverted during testing. (This one I could implement, but I'd need to make sure it respects policy)
- Not doing anything. As of now, this approach seems to not have caused very many issues.
Metadata
Metadata
Assignees
Labels
Area: Source-based code coverage (-Cinstrument-coverage)Area: `std::io`, `std::fs`, `std::net` and `std::path`Category: This is a bug.Call for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Operating system: WindowsRelevant to the library team, which will review and decide on the PR/issue.