diff options
Diffstat (limited to 'Omni/Agent.hs')
| -rw-r--r-- | Omni/Agent.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Omni/Agent.hs b/Omni/Agent.hs index af785eb..d53bccd 100644 --- a/Omni/Agent.hs +++ b/Omni/Agent.hs @@ -13,6 +13,7 @@ import qualified Omni.Agent.Core as Core import qualified Omni.Agent.Worker as Worker import qualified Omni.Cli as Cli import qualified Omni.Test as Test +import qualified System.Console.Docopt as Docopt main :: IO () main = Cli.main plan @@ -62,4 +63,15 @@ move args | otherwise = putStrLn (Cli.usage help) test :: Test.Tree -test = Test.group "Omni.Agent" [] +test = Test.group "Omni.Agent" [unitTests] + +unitTests :: Test.Tree +unitTests = + Test.group + "Unit tests" + [ Test.unit "can parse start command" <| do + let result = Docopt.parseArgs help ["start", "worker-1"] + case result of + Left err -> Test.assertFailure <| "Failed to parse 'start': " <> show err + Right args -> args `Cli.has` Cli.command "start" Test.@?= True + ] |
