We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f7c394 commit 3844cc1Copy full SHA for 3844cc1
src/Tests/SimpleAsyncTest.fs
@@ -81,5 +81,28 @@ let ``03 --word Hello -w World return Task<int>`` () = task {
81
returnedCode =! 5
82
}
83
84
+[<Test>]
85
+let ``04 --fail test`` () = task {
86
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
+}
108
0 commit comments