summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2022-01-17 20:06:31 +0800
committerGitHub <noreply@github.com>2022-01-17 13:06:31 +0100
commitbc3bee54698b108977766b6b2daf8a33bd00d1ef (patch)
tree47b80e3bcdc97b6a47124acdf54442ed7027c337 /tests/stdlib
parent07c7a8a526cf4fd12c96192cda7a750fbea3382f (diff)
downloadNim-bc3bee54698b108977766b6b2daf8a33bd00d1ef.tar.gz
Added `std/oserrors` for OS error reporting (#19390)
* Added 'std/oserrors' for OS error reporting

* add a simple test

* New code should not support -d:useWinAnsi anymore

thanks to @Araq
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/toserrors.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/stdlib/toserrors.nim b/tests/stdlib/toserrors.nim
new file mode 100644
index 000000000..e907dfe63
--- /dev/null
+++ b/tests/stdlib/toserrors.nim
@@ -0,0 +1,9 @@
+discard """
+  action: compile
+"""
+
+import std/oserrors
+
+let x1 = osLastError()
+raiseOSError(x1)
+echo osErrorMsg(x1)