Skip to content

Commit a1be444

Browse files
felipecgitster
authored andcommitted
completion: simplify tests using test_completion_long()
No need to duplicate that functionality. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43ea081 commit a1be444

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

t/t9902-completion.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ test_expect_success 'basic' '
172172
'
173173

174174
test_expect_success 'double dash "git" itself' '
175-
sed -e "s/Z$//" >expected <<-\EOF &&
175+
test_completion_long "git --" <<-\EOF
176176
--paginate Z
177177
--no-pager Z
178178
--git-dir=
@@ -187,11 +187,10 @@ test_expect_success 'double dash "git" itself' '
187187
--no-replace-objects Z
188188
--help Z
189189
EOF
190-
test_completion "git --"
191190
'
192191

193192
test_expect_success 'double dash "git checkout"' '
194-
sed -e "s/Z$//" >expected <<-\EOF &&
193+
test_completion_long "git checkout --" <<-\EOF
195194
--quiet Z
196195
--ours Z
197196
--theirs Z
@@ -202,17 +201,15 @@ test_expect_success 'double dash "git checkout"' '
202201
--orphan Z
203202
--patch Z
204203
EOF
205-
test_completion "git checkout --"
206204
'
207205

208206
test_expect_success 'general options' '
209207
test_completion "git --ver" "--version " &&
210208
test_completion "git --hel" "--help " &&
211-
sed -e "s/Z$//" >expected <<-\EOF &&
209+
test_completion_long "git --exe" <<-\EOF &&
212210
--exec-path Z
213211
--exec-path=
214212
EOF
215-
test_completion "git --exe" &&
216213
test_completion "git --htm" "--html-path " &&
217214
test_completion "git --pag" "--paginate " &&
218215
test_completion "git --no-p" "--no-pager " &&

0 commit comments

Comments
 (0)