1
0
mirror of https://github.com/git/git.git synced 2024-10-19 08:18:14 +02:00

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>
This commit is contained in:
Felipe Contreras 2012-11-11 15:35:54 +01:00 committed by Junio C Hamano
parent 701ecdf16b
commit 43ea081235

@ -66,11 +66,10 @@ test_completion ()
} }
# Like test_completion, but reads expectation from stdin, # Like test_completion, but reads expectation from stdin,
# which is convenient when it is multiline. We also process "_" into # which is convenient when it is multiline.
# spaces to make test vectors more readable.
test_completion_long () test_completion_long ()
{ {
tr _ " " >expected && sed -e 's/Z$//' >expected &&
test_completion "$1" test_completion "$1"
} }
@ -252,24 +251,24 @@ test_expect_success 'setup for ref completion' '
test_expect_success 'checkout completes ref names' ' test_expect_success 'checkout completes ref names' '
test_completion_long "git checkout m" <<-\EOF test_completion_long "git checkout m" <<-\EOF
master_ master Z
mybranch_ mybranch Z
mytag_ mytag Z
EOF EOF
' '
test_expect_success 'show completes all refs' ' test_expect_success 'show completes all refs' '
test_completion_long "git show m" <<-\EOF test_completion_long "git show m" <<-\EOF
master_ master Z
mybranch_ mybranch Z
mytag_ mytag Z
EOF EOF
' '
test_expect_success '<ref>: completes paths' ' test_expect_success '<ref>: completes paths' '
test_completion_long "git show mytag:f" <<-\EOF test_completion_long "git show mytag:f" <<-\EOF
file1_ file1 Z
file2_ file2 Z
EOF EOF
' '
@ -278,7 +277,7 @@ test_expect_success 'complete tree filename with spaces' '
git add . && git add . &&
git commit -m spaces && git commit -m spaces &&
test_completion_long "git show HEAD:nam" <<-\EOF test_completion_long "git show HEAD:nam" <<-\EOF
name with spaces_ name with spaces Z
EOF EOF
' '
@ -287,8 +286,8 @@ test_expect_failure 'complete tree filename with metacharacters' '
git add . && git add . &&
git commit -m meta && git commit -m meta &&
test_completion_long "git show HEAD:nam" <<-\EOF test_completion_long "git show HEAD:nam" <<-\EOF
name with ${meta}_ name with ${meta} Z
name with spaces_ name with spaces Z
EOF EOF
' '