Idris2/tests/base/system_errno/Test.idr
Stiopa Koltsov 1617d95961 System.Errno.strerror
* add `strerror` function
* move `getErrno` to `System.Errno`
* use `strerror` in `Show FileError`
* on node there's no access to `strerror`, so `strerror` just converts the number to string
2021-07-13 10:34:04 +01:00

14 lines
292 B
Idris

import System
import System.Errno
main : IO ()
main = do
-- `2` is `ENOENT` on all OS
-- and the message is the same on all OS
let s = strerror 2
True <- pure (s == "No such file or directory")
| False => do
putStrLn ("strerror for 2 is " ++ s)
exitFailure
pure ()