summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Omni/Jr.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Omni/Jr.hs b/Omni/Jr.hs
index 8636e54..8200be5 100644
--- a/Omni/Jr.hs
+++ b/Omni/Jr.hs
@@ -398,6 +398,18 @@ test =
Test.group
"Omni.Jr"
[ Test.unit "can run tests" <| True Test.@?= True,
+ Test.unit "can parse task command" <| do
+ let result = Docopt.parseArgs help ["task"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'task': " <> show err
+ Right args -> args `Cli.has` Cli.command "task" Test.@?= True,
+ Test.unit "can parse task command with args" <| do
+ let result = Docopt.parseArgs help ["task", "list", "--json"]
+ case result of
+ Left err -> Test.assertFailure <| "Failed to parse 'task list --json': " <> show err
+ Right args -> do
+ args `Cli.has` Cli.command "task" Test.@?= True
+ Cli.getAllArgs args (Cli.argument "args") Test.@?= ["list", "--json"],
Test.unit "can parse work command" <| do
let result = Docopt.parseArgs help ["work"]
case result of