hls-test-utils-1.4.0.0: Utilities used in the tests of Haskell Language Server
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Hls.Util

Synopsis

Documentation

expectNoMoreDiagnostics :: Seconds -> TextDocumentIdentifier -> String -> Session () Source #

wait for timeout seconds and report an assertion failure if any diagnostic messages arrive in that period

data OS Source #

Constructors

Windows 
MacOS 
Linux 

Instances

Instances details
Show OS Source # 
Instance details

Defined in Test.Hls.Util

Methods

showsPrec :: Int -> OS -> ShowS #

show :: OS -> String #

showList :: [OS] -> ShowS #

Eq OS Source # 
Instance details

Defined in Test.Hls.Util

Methods

(==) :: OS -> OS -> Bool #

(/=) :: OS -> OS -> Bool #

data EnvSpec Source #

Constructors

HostOS OS 
GhcVer GhcVersion 

Instances

Instances details
Show EnvSpec Source # 
Instance details

Defined in Test.Hls.Util

Eq EnvSpec Source # 
Instance details

Defined in Test.Hls.Util

Methods

(==) :: EnvSpec -> EnvSpec -> Bool #

(/=) :: EnvSpec -> EnvSpec -> Bool #

ignoreInEnv :: [EnvSpec] -> String -> TestTree -> TestTree Source #

IgnoreTest if any of environmental spec mathces the current environment.

onlyRunForGhcVersions :: [GhcVersion] -> String -> TestTree -> TestTree Source #

Ignore the test if GHC does not match only work versions.

knownBrokenInEnv :: [EnvSpec] -> String -> TestTree -> TestTree Source #

Mark as broken if any of environmental spec mathces the current environment.

onlyWorkForGhcVersions :: (GhcVersion -> Bool) -> String -> TestTree -> TestTree Source #

Mark as broken if GHC does not match only work versions.

type SymbolLocation = (FilePath, UInt, UInt) Source #

To locate a symbol, we provide a path to the file from the HLS root directory, the line number, and the column number. (0 indexed.)

waitForDiagnosticsFromSourceWithTimeout :: Seconds -> TextDocumentIdentifier -> String -> Session [Diagnostic] Source #

wait for timeout seconds and return diagnostics for the given document and source. If timeout is 0 it will wait until the session timeout

withCurrentDirectoryInTmp :: FilePath -> IO a -> IO a Source #

Like withCurrentDirectory, but will copy the directory over to the system temporary directory first to avoid haskell-language-server's source tree from interfering with the cradle.

Ignores directories containing build artefacts to avoid interference and provide reproducible test-behaviour.

withCurrentDirectoryInTmp' :: [FilePath] -> FilePath -> IO a -> IO a Source #

Like withCurrentDirectory, but will copy the directory over to the system temporary directory first to avoid haskell-language-server's source tree from interfering with the cradle.

You may specify directories to ignore, but should be careful to maintain reproducibility.