File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed
ArgumentParserExampleTests Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,31 @@ extension MathExampleTests {
185
185
command: " math --generate-completion-script zsh " ,
186
186
expected: zshCompletionScriptText)
187
187
}
188
+
189
+ func testMath_CustomCompletion( ) {
190
+ AssertExecuteCommand (
191
+ command: " math ---completion stats quantiles -- --custom " ,
192
+ expected: """
193
+ hello
194
+ helicopter
195
+ heliotrope
196
+ """ )
197
+
198
+ AssertExecuteCommand (
199
+ command: " math ---completion stats quantiles -- --custom h " ,
200
+ expected: """
201
+ hello
202
+ helicopter
203
+ heliotrope
204
+ """ )
205
+
206
+ AssertExecuteCommand (
207
+ command: " math ---completion stats quantiles -- --custom a " ,
208
+ expected: """
209
+ aardvark
210
+ aaaaalbert
211
+ """ )
212
+ }
188
213
}
189
214
190
215
private let bashCompletionScriptText = """
Original file line number Diff line number Diff line change @@ -116,16 +116,7 @@ extension CompletionScriptTests {
116
116
}
117
117
118
118
func testEscaped_Zsh( ) throws {
119
- let script1 = try CompletionsGenerator ( command: Escaped . self, shell: . zsh)
120
- . generateCompletionScript ( )
121
- XCTAssertEqual ( zshEscapedCompletion, script1)
122
-
123
- let script2 = try CompletionsGenerator ( command: Escaped . self, shellName: " zsh " )
124
- . generateCompletionScript ( )
125
- XCTAssertEqual ( zshEscapedCompletion, script2)
126
-
127
- let script3 = Escaped . completionScript ( for: . zsh)
128
- XCTAssertEqual ( zshEscapedCompletion, script3)
119
+ XCTAssertEqual ( zshEscapedCompletion, Escaped . completionScript ( for: . zsh) )
129
120
}
130
121
}
131
122
You can’t perform that action at this time.
0 commit comments