Add 'test' command for running QuickCheck props
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user