mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
os: confine osErrorMsg example to Linux (#11725)
POSIX does **not** define the exact number for each errors. This caused a failure in docs building on Haiku.
This commit is contained in:
@@ -31,7 +31,7 @@ proc osErrorMsg*(errorCode: OSErrorCode): string =
|
||||
## * `raiseOSError proc <#raiseOSError,OSErrorCode,string>`_
|
||||
## * `osLastError proc <#osLastError>`_
|
||||
runnableExamples:
|
||||
when defined(posix):
|
||||
when defined(linux):
|
||||
assert osErrorMsg(OSErrorCode(0)) == ""
|
||||
assert osErrorMsg(OSErrorCode(1)) == "Operation not permitted"
|
||||
assert osErrorMsg(OSErrorCode(2)) == "No such file or directory"
|
||||
|
||||
Reference in New Issue
Block a user