Add 'test' command for running QuickCheck props

This commit is contained in:
Daniel Gröber
2015-12-16 00:25:15 +01:00
parent 41b9c0bbf2
commit 7374f1ba17
5 changed files with 52 additions and 0 deletions

View File

@@ -161,6 +161,7 @@ ghcCommands (CmdMapFile f) =
>> return ""
ghcCommands (CmdUnmapFile f) = unloadMappedFile f >> return ""
ghcCommands (CmdQuit) = liftIO exitSuccess
ghcCommands (CmdTest file) = test file
ghcCommands cmd = throw $ InvalidCommandLine $ Left $ show cmd
newtype InvalidCommandLine = InvalidCommandLine (Either String String)

View File

@@ -60,6 +60,7 @@ data GhcModCommands =
| CmdMapFile FilePath
| CmdUnmapFile FilePath
| CmdQuit
| CmdTest FilePath
deriving (Show)
commandsSpec :: Parser GhcModCommands
@@ -182,6 +183,10 @@ commands =
\\ " `[a]', which results in:"
code "filterNothing xs = filter _body_1 _body_2"
"(See also: https://github.com/kazu-yamamoto/ghc-mod/issues/311)"
<> command "test"
$$ info (CmdTest <$> strArg "FILE")
$$ progDesc ""
interactiveCommandsSpec :: Parser GhcModCommands
interactiveCommandsSpec =