diff options
Diffstat (limited to 'tests/mailmap/basic.c')
-rw-r--r-- | tests/mailmap/basic.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/tests/mailmap/basic.c b/tests/mailmap/basic.c index 9b06f184d..508598440 100644 --- a/tests/mailmap/basic.c +++ b/tests/mailmap/basic.c @@ -15,7 +15,10 @@ const char TEST_MAILMAP[] = void test_mailmap_basic__initialize(void) { - cl_git_pass(git_mailmap_parse(&mailmap, TEST_MAILMAP, sizeof(TEST_MAILMAP) - 1)); + git_buf buf = GIT_BUF_INIT; + git_buf_attach_notowned(&buf, TEST_MAILMAP, sizeof(TEST_MAILMAP) - 1); + + cl_git_pass(git_mailmap_from_buffer(&mailmap, &buf)); } void test_mailmap_basic__cleanup(void) @@ -53,9 +56,7 @@ void test_mailmap_basic__lookup_not_found(void) void test_mailmap_basic__lookup(void) { const git_mailmap_entry *entry = git_mailmap_entry_lookup( - mailmap, - "Typoed the name once", - "foo@baz.com"); + mailmap, "Typoed the name once", "foo@baz.com"); cl_assert(entry); cl_assert(!git__strcmp(entry->real_name, "Foo bar")); } @@ -65,11 +66,7 @@ void test_mailmap_basic__empty_email_query(void) const char *name; const char *email; git_mailmap_resolve( - &name, - &email, - mailmap, - "Author name", - "otheremail@foo.com"); + &name, &email, mailmap, "Author name", "otheremail@foo.com"); cl_assert(!git__strcmp(name, "Author name")); cl_assert(!git__strcmp(email, "email@foo.com")); } @@ -79,20 +76,13 @@ void test_mailmap_basic__name_matching(void) const char *name; const char *email; git_mailmap_resolve( - &name, - &email, - mailmap, - "Other Name", - "yetanotheremail@foo.com"); + &name, &email, mailmap, "Other Name", "yetanotheremail@foo.com"); cl_assert(!git__strcmp(name, "Other Name")); cl_assert(!git__strcmp(email, "email@foo.com")); git_mailmap_resolve( - &name, - &email, - mailmap, - "Other Name That Doesn't Match", - "yetanotheremail@foo.com"); + &name, &email, mailmap, + "Other Name That Doesn't Match", "yetanotheremail@foo.com"); cl_assert(!git__strcmp(name, "Other Name That Doesn't Match")); cl_assert(!git__strcmp(email, "yetanotheremail@foo.com")); } |