mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 16:20:01 +00:00

Clay is the name of a programming language on the makings, and we want to avoid confusions. Sorry for the huge diff!
29 lines
827 B
C
29 lines
827 B
C
#include "clar_libgit2.h"
|
|
|
|
/* compare prefixes */
|
|
void test_core_string__0(void)
|
|
{
|
|
cl_assert(git__prefixcmp("", "") == 0);
|
|
cl_assert(git__prefixcmp("a", "") == 0);
|
|
cl_assert(git__prefixcmp("", "a") < 0);
|
|
cl_assert(git__prefixcmp("a", "b") < 0);
|
|
cl_assert(git__prefixcmp("b", "a") > 0);
|
|
cl_assert(git__prefixcmp("ab", "a") == 0);
|
|
cl_assert(git__prefixcmp("ab", "ac") < 0);
|
|
cl_assert(git__prefixcmp("ab", "aa") > 0);
|
|
}
|
|
|
|
/* compare suffixes */
|
|
void test_core_string__1(void)
|
|
{
|
|
cl_assert(git__suffixcmp("", "") == 0);
|
|
cl_assert(git__suffixcmp("a", "") == 0);
|
|
cl_assert(git__suffixcmp("", "a") < 0);
|
|
cl_assert(git__suffixcmp("a", "b") < 0);
|
|
cl_assert(git__suffixcmp("b", "a") > 0);
|
|
cl_assert(git__suffixcmp("ba", "a") == 0);
|
|
cl_assert(git__suffixcmp("zaa", "ac") < 0);
|
|
cl_assert(git__suffixcmp("zaz", "ac") > 0);
|
|
}
|
|
|