Skip to content

Commit 3844cc1

Browse files
committed
Added failing test for Issue #32
1 parent 7f7c394 commit 3844cc1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Tests/SimpleAsyncTest.fs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,28 @@ let ``03 --word Hello -w World return Task<int>`` () = task {
8181
returnedCode =! 5
8282
}
8383

84+
[<Test>]
85+
let ``04 --fail test`` () = task {
8486

87+
let failCmd =
88+
command "fail" {
89+
description "Will fail"
90+
inputs (optionMaybe<bool> "--sample")
91+
setAction (fun (sample: bool option) ->
92+
task {
93+
handlerCalled <- true
94+
return 1 // should fail
95+
}
96+
)
97+
}
98+
99+
let! returnedCode =
100+
testRootCommand "fail --sample true" {
101+
description "Sample of swallowing exit code"
102+
noActionAsync
103+
addCommand failCmd
104+
}
105+
106+
returnedCode =! 1
107+
}
85108

0 commit comments

Comments
 (0)