Skip to content

Commit 43ea081

Browse files
felipecgitster
authored andcommitted
completion: standardize final space marker in tests
The rest of the code uses ' Z$'. Lets use that for test_completion_long() as well. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 701ecdf commit 43ea081

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

t/t9902-completion.sh

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ test_completion ()
6666
}
6767

6868
# Like test_completion, but reads expectation from stdin,
69-
# which is convenient when it is multiline. We also process "_" into
70-
# spaces to make test vectors more readable.
69+
# which is convenient when it is multiline.
7170
test_completion_long ()
7271
{
73-
tr _ " " >expected &&
72+
sed -e 's/Z$//' >expected &&
7473
test_completion "$1"
7574
}
7675

@@ -252,24 +251,24 @@ test_expect_success 'setup for ref completion' '
252251

253252
test_expect_success 'checkout completes ref names' '
254253
test_completion_long "git checkout m" <<-\EOF
255-
master_
256-
mybranch_
257-
mytag_
254+
master Z
255+
mybranch Z
256+
mytag Z
258257
EOF
259258
'
260259

261260
test_expect_success 'show completes all refs' '
262261
test_completion_long "git show m" <<-\EOF
263-
master_
264-
mybranch_
265-
mytag_
262+
master Z
263+
mybranch Z
264+
mytag Z
266265
EOF
267266
'
268267

269268
test_expect_success '<ref>: completes paths' '
270269
test_completion_long "git show mytag:f" <<-\EOF
271-
file1_
272-
file2_
270+
file1 Z
271+
file2 Z
273272
EOF
274273
'
275274

@@ -278,7 +277,7 @@ test_expect_success 'complete tree filename with spaces' '
278277
git add . &&
279278
git commit -m spaces &&
280279
test_completion_long "git show HEAD:nam" <<-\EOF
281-
name with spaces_
280+
name with spaces Z
282281
EOF
283282
'
284283

@@ -287,8 +286,8 @@ test_expect_failure 'complete tree filename with metacharacters' '
287286
git add . &&
288287
git commit -m meta &&
289288
test_completion_long "git show HEAD:nam" <<-\EOF
290-
name with ${meta}_
291-
name with spaces_
289+
name with ${meta} Z
290+
name with spaces Z
292291
EOF
293292
'
294293

0 commit comments

Comments
 (0)