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:
parent
df17cf5e9e
commit
23d23ecb08
3 changed files with 30 additions and 8 deletions
11
tests/exception/t16366.nim
Normal file
11
tests/exception/t16366.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
action: run
|
||||
exitcode: 0
|
||||
targets: "c cpp"
|
||||
disabled: openbsd
|
||||
"""
|
||||
|
||||
echo "foo1"
|
||||
close stdout
|
||||
doAssertRaises(IOError):
|
||||
echo "foo"
|
||||
Loading…
Add table
Add a link
Reference in a new issue