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:
alaviss 2019-07-13 21:16:09 +07:00 • committed by Andreas Rumpf
commit a59fb5b352

View file

@ -31,7 +31,7 @@ proc osErrorMsg*(errorCode: OSErrorCode): string =
## * `raiseOSError proc <#raiseOSError,OSErrorCode,string>`_ ## * `raiseOSError proc <#raiseOSError,OSErrorCode,string>`_
## * `osLastError proc <#osLastError>`_ ## * `osLastError proc <#osLastError>`_
runnableExamples: runnableExamples:
when defined(posix): when defined(linux):
assert osErrorMsg(OSErrorCode(0)) == "" assert osErrorMsg(OSErrorCode(0)) == ""
assert osErrorMsg(OSErrorCode(1)) == "Operation not permitted" assert osErrorMsg(OSErrorCode(1)) == "Operation not permitted"
assert osErrorMsg(OSErrorCode(2)) == "No such file or directory" assert osErrorMsg(OSErrorCode(2)) == "No such file or directory"