Make 'echo' raise IOErrors when appropriate (#16367)

* Make 'echo' raise IOError when fwrite/fflush fail

* Fix fwrite return value comparison

* Add test for echo raising error and don't fail to release locks in echo

* Fix exitcode expectation

* Make 'echo' raise IOError on Windows if it fails

* Add nimLegacyEchoNoRaise for prior no-IOError echo behavior

* Use checkErrMaybe template
This commit is contained in:
Matt Haggard 2020-12-18 04:06:13 -05:00 • committed by GitHub
commit 23d23ecb08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 8 deletions

View file

@ -0,0 +1,11 @@
discard """
action: run
exitcode: 0
targets: "c cpp"
disabled: openbsd
"""
echo "foo1"
close stdout
doAssertRaises(IOError):
echo "foo"