Test functions should not close stdout or stderr since these are managed by testo. For example, the test function (fun () -> close_out stdout) results in an uncaught exception when or after running the test:
test: internal error, uncaught exception:
Sys_error("Bad file descriptor")
Raised by primitive operation at CamlinternalFormat.output_acc in file "camlinternalFormat.ml", line 1908, characters 48-63
...
I don't think we can prevent user code from accidentally closing stdout or stderr but maybe we can help the user fix their test function:
- Catch exceptions when calling
flush, close, etc.
- Explain that there's either a bug in testo or that a specific test closed stdout or stderr.
Test functions should not close stdout or stderr since these are managed by testo. For example, the test function
(fun () -> close_out stdout)results in an uncaught exception when or after running the test:I don't think we can prevent user code from accidentally closing stdout or stderr but maybe we can help the user fix their test function:
flush,close, etc.