Module

CompileFail

Package
purescript-compile-fail
Repository
rowtype-yoga/purescript-compile-fail

#CompileFailResult Source

type CompileFailResult = { compilationFailed :: Boolean, containsExpected :: Boolean, expected :: Maybe String, file :: String, output :: String }

#CompileContext Source

type CompileContext = { outputDir :: String, sources :: Array String }

#spagoSources Source

spagoSources :: Aff (Array String)

Get source globs from spago, excluding test sources

#warmCache Source

warmCache :: CompileContext -> Aff Unit

Warm the purs compile cache by compiling all library sources

#parseExpect Source

parseExpect :: String -> Maybe String

Parse the expected error from the first line of a file. Files should start with: -- EXPECT: <substring>

#compileFile Source

compileFile :: CompileContext -> String -> Aff CompileFailResult

Compile a single file and check whether it fails with the expected error. Reads the file to extract the EXPECT comment.

#compileFileWithContent Source

compileFileWithContent :: CompileContext -> String -> String -> Aff CompileFailResult

Compile a file whose content is provided, checking against the EXPECT comment

#compileSpagoFile Source

compileSpagoFile :: { projectRoot :: String } -> String -> Aff { exitCode :: Int, file :: String, stderr :: String, stdout :: String }