News for hackers. Stuff that matters.
Re:In-Memory Filesystems in Rust by ozgrakkurt on Tuesday August 26, 2025 @11:50PM (#45035276)
My point is, you can give gibberish data to a processing function if it just takes in-memory data instead of being parameterized by β€œIO”.

If you parameterize everything by IO then you have to mock the IO

Re:In-Memory Filesystems in Rust by Arch-TK on Thursday August 28, 2025 @10:47AM (#45052874)
It's not just about gibberish data. It's read failures, write failures, open failures, for a variety of reasons including permission errors, disk errors, space errors, etc.

You basically want to test your code does something sensical with either every possible combination of errors, or with some random subset of combinations of errors. This can be automated and can verify the behaviour of your program in the edge cases. It's actually not usually that helpful to only test "we read corrupt garbage from the file" which is the thing you're describing here.