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.

(cherry picked from commit a59fb5b352)
This commit is contained in:
alaviss
2019-07-13 21:16:09 +07:00
committed by narimiran
parent d5d661b70e
commit c4cbc5f449

View File

@@ -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"