[test][s]: add tests for file streams and for file streams with encoding (exposing a bug).