testlib icon indicating copy to clipboard operation
testlib copied to clipboard

fix: don't skip BOM on standard streams, fix #160

Open yhx-12243 opened this issue 3 years ago • 3 comments

Standard streams does not need to skip BOM, otherwise it will cause infinite waiting (blocking) in interactions.

yhx-12243 avatar Aug 11 '22 09:08 yhx-12243

Maybe we could check whether the file descriptor is a normal file or not and only skipBom for normal files?

Menci avatar Aug 12 '22 14:08 Menci

I think it is possible to check if the input stream ends when trying to skip BOM, instead of waiting for a BOM header forever.

undefined-moe avatar Aug 13 '22 11:08 undefined-moe

I prefer to use skipBom only in checker-mode for outputs (where it actually can be usefull). Also added tests, see https://github.com/MikeMirzayanov/testlib/commit/139afc4c51c7439a5dda105690452faf36f75b88

MikeMirzayanov avatar Aug 13 '22 13:08 MikeMirzayanov