I was making a Brainf*ck interpreter, and while I was testing the entire thing for correctness, I found that everything worked flawlessly, except piped input. For some reason, whenever I pipe the input, it goes nuts, but whenever I copy-paste the same Brainf*ck program with interactive input or by specifying a file, it works flawlessly.
I spent several days trying to debug the issue without any success. I suspect that it's the way that I handle IO, but I am not sure where I did wrong.
The only places I do IO in are main and lib::engine::Engine::run
https://gitlab.com/alexmozaidze/brainfuck-rs/-/tree/dev/src?ref_type=heads