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 <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
Nov 11, 2012 at 15:35 UTC
43ea081235dfebdd34ad16e873105dabdec075fb
1 file changed
+13
-14
t/t9902-completion.sh
+13
-14
@@ -66,11 +66,10 @@ test_completion ()
66
}
67
68
# 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.
70
test_completion_long ()
71
{
73
- tr _ " " >expected &&
72
+ sed -e 's/Z$//' >expected &&
73
test_completion "$1"
74
}
75
@@ -252,24 +251,24 @@ test_expect_success 'setup for ref completion' '
251
252
test_expect_success 'checkout completes ref names' '
253
test_completion_long "git checkout m" <<-\EOF
255
- master_
256
- mybranch_
257
- mytag_
254
+ master Z
255
+ mybranch Z
256
+ mytag Z
257
EOF
258
'
259
260
test_expect_success 'show completes all refs' '
261
test_completion_long "git show m" <<-\EOF
263
- master_
264
- mybranch_
265
- mytag_
262
+ master Z
263
+ mybranch Z
264
+ mytag Z
265
EOF
266
'
267
268
test_expect_success '<ref>: completes paths' '
269
test_completion_long "git show mytag:f" <<-\EOF
271
- file1_
272
- file2_
270
+ file1 Z
271
+ file2 Z
272
EOF
273
'
274
@@ -278,7 +277,7 @@ test_expect_success 'complete tree filename with spaces' '
277
git add . &&
278
git commit -m spaces &&
279
test_completion_long "git show HEAD:nam" <<-\EOF
281
- name with spaces_
280
+ name with spaces Z
281
EOF
282
'
283
@@ -287,8 +286,8 @@ test_expect_failure 'complete tree filename with metacharacters' '
286
git add . &&
287
git commit -m meta &&
288
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
291
EOF
292
'
293