summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorMatt Haggard <haggardii@gmail.com>2020-12-18 04:06:13 -0500
committerGitHub <noreply@github.com>2020-12-18 10:06:13 +0100
commit23d23ecb081be6702d74024be8f96d92d9f88a59 (patch)
tree9e8d6dff07ff798f04106882c99aa871319bddce /tests
parentdf17cf5e9e1afae333d9ab755d19d1c9d4d60a0f (diff)
downloadNim-23d23ecb081be6702d74024be8f96d92d9f88a59.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/exception/t16366.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/exception/t16366.nim b/tests/exception/t16366.nim
new file mode 100644
index 000000000..4bcad79ed
--- /dev/null
+++ b/tests/exception/t16366.nim
@@ -0,0 +1,11 @@
+discard """
+  action: run
+  exitcode: 0
+  targets: "c cpp"
+  disabled: openbsd
+"""
+
+echo "foo1"
+close stdout
+doAssertRaises(IOError):
+  echo "foo"