packages feed

directory-1.3.0.0: tests/PathIsSymbolicLink.hs

{-# LANGUAGE CPP #-}
module PathIsSymbolicLink where
#include "util.inl"
import TestUtils

main :: TestEnv -> IO ()
main _t = do
  success <- (createSymbolicLink "x" "y" >> return True)
#ifdef mingw32_HOST_OS
    -- only test if symbolic links can be created
    -- (usually disabled on Windows by group policy)
    `catchIOError` \ e ->
      if isPermissionError e
      then return False
      else ioError e
#endif
  when success $
    T(expect) () =<< pathIsSymbolicLink "y"