diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-12 18:55:38 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-12-01 11:34:28 +0400 |
commit | 18d6f120402255f2e2a192553e20c1048f55a303 (patch) | |
tree | caef74ef9261fc748a988f208f016e60dc66bde7 /tests-clar/object | |
parent | 80212ecb1c2ce3e27d1a4ffe053e36260ee06c01 (diff) |
tag: Deploy EINVALIDSPEC usage
Diffstat (limited to 'tests-clar/object')
-rw-r--r-- | tests-clar/object/tag/write.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests-clar/object/tag/write.c b/tests-clar/object/tag/write.c index ad6ca76b2..eb0ac2897 100644 --- a/tests-clar/object/tag/write.c +++ b/tests-clar/object/tag/write.c @@ -88,7 +88,6 @@ void test_object_tag_write__overwrite(void) git_object_free(target); git_signature_free(tagger); - } void test_object_tag_write__replace(void) @@ -190,3 +189,33 @@ void test_object_tag_write__delete(void) git_reference_free(ref_tag); } + +void test_object_tag_write__creating_with_an_invalid_name_returns_EINVALIDSPEC(void) +{ + git_oid target_id, tag_id; + git_signature *tagger; + git_object *target; + + git_oid_fromstr(&target_id, tagged_commit); + cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJ_COMMIT)); + + cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60)); + + cl_assert_equal_i(GIT_EINVALIDSPEC, + git_tag_create(&tag_id, g_repo, + "Inv@{id", target, tagger, tagger_message, 0) + ); + + cl_assert_equal_i(GIT_EINVALIDSPEC, + git_tag_create_lightweight(&tag_id, g_repo, + "Inv@{id", target, 0) + ); + + git_object_free(target); + git_signature_free(tagger); +} + +void test_object_tag_write__deleting_with_an_invalid_name_returns_EINVALIDSPEC(void) +{ + cl_assert_equal_i(GIT_EINVALIDSPEC, git_tag_delete(g_repo, "Inv@{id")); +} |