Idris2/tests/base/system_directory/ReadDir.idr

13 lines
284 B
Idris
Raw Normal View History

import System
import System.Directory
panic : String -> IO a
panic s = do putStrLn s
exitFailure
main : IO ()
main = do Right ["a"] <- listDir "dir"
| Left e => panic (show e)
| Right x => panic ("wrong entries: " ++ (show x))
pure ()