summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2012-11-11 14:35:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-11-16 18:57:52 (GMT)
commit43ea081235dfebdd34ad16e873105dabdec075fb (patch)
treebf218e9071816bc3d6401ae3dd22167136a6c1b5 /t/t9902-completion.sh
parent701ecdf16b3941ad1928520414942776e695308d (diff)
downloadgit-43ea081235dfebdd34ad16e873105dabdec075fb.zip
git-43ea081235dfebdd34ad16e873105dabdec075fb.tar.gz
git-43ea081235dfebdd34ad16e873105dabdec075fb.tar.bz2
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>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh27
1 files changed, 13 insertions, 14 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 5c06709..9778a1b 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -66,11 +66,10 @@ test_completion ()
}
# Like test_completion, but reads expectation from stdin,
-# which is convenient when it is multiline. We also process "_" into
-# spaces to make test vectors more readable.
+# which is convenient when it is multiline.
test_completion_long ()
{
- tr _ " " >expected &&
+ sed -e 's/Z$//' >expected &&
test_completion "$1"
}
@@ -252,24 +251,24 @@ test_expect_success 'setup for ref completion' '
test_expect_success 'checkout completes ref names' '
test_completion_long "git checkout m" <<-\EOF
- master_
- mybranch_
- mytag_
+ master Z
+ mybranch Z
+ mytag Z
EOF
'
test_expect_success 'show completes all refs' '
test_completion_long "git show m" <<-\EOF
- master_
- mybranch_
- mytag_
+ master Z
+ mybranch Z
+ mytag Z
EOF
'
test_expect_success '<ref>: completes paths' '
test_completion_long "git show mytag:f" <<-\EOF
- file1_
- file2_
+ file1 Z
+ file2 Z
EOF
'
@@ -278,7 +277,7 @@ test_expect_success 'complete tree filename with spaces' '
git add . &&
git commit -m spaces &&
test_completion_long "git show HEAD:nam" <<-\EOF
- name with spaces_
+ name with spaces Z
EOF
'
@@ -287,8 +286,8 @@ test_expect_failure 'complete tree filename with metacharacters' '
git add . &&
git commit -m meta &&
test_completion_long "git show HEAD:nam" <<-\EOF
- name with ${meta}_
- name with spaces_
+ name with ${meta} Z
+ name with spaces Z
EOF
'