summaryrefslogtreecommitdiff
path: root/t/t3301-notes.sh
diff options
context:
space:
mode:
authorDoan Tran Cong Danh <congdanhqx@gmail.com>2019-10-16 05:18:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-18 00:39:07 (GMT)
commit8af69cf3e214ee9df3f78bd508465b75881b17a8 (patch)
treeba85041963b7c36a2bbcd9ef452b89425f81e60b /t/t3301-notes.sh
parent108b97dc372828f0e72e56bbb40cae8e1e83ece6 (diff)
downloadgit-8af69cf3e214ee9df3f78bd508465b75881b17a8.zip
git-8af69cf3e214ee9df3f78bd508465b75881b17a8.tar.gz
git-8af69cf3e214ee9df3f78bd508465b75881b17a8.tar.bz2
t3301: test diagnose messages for too few/many paramters
Commit bbb1b8a35a ("notes: check number of parameters to "git notes copy"", 2010-06-28) added a test for too many or too few of parameters provided to `git notes copy'. However, the test only ensures that the command will fail but it doesn't really check if it fails because of number of parameters. If we accidentally lifted the check inside our code base, the test may still have failed because the provided parameter is not a valid ref. Correct it. Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3301-notes.sh')
-rwxr-xr-xt/t3301-notes.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index d3fa298..d7767e4 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -1167,8 +1167,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '
'
test_expect_success 'git notes copy diagnoses too many or too few parameters' '
- test_must_fail git notes copy &&
- test_must_fail git notes copy one two three
+ test_must_fail git notes copy 2>error &&
+ test_i18ngrep "too few parameters" error &&
+ test_must_fail git notes copy one two three 2>error &&
+ test_i18ngrep "too many parameters" error
'
test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' '