diff options
author | Arthur Schreiber <arthurschreiber@github.com> | 2016-10-06 13:15:31 +0200 |
---|---|---|
committer | Arthur Schreiber <arthurschreiber@github.com> | 2016-10-06 13:15:31 +0200 |
commit | ab96ca5572f1aae6bc7f889fbd46f56fc959ba2b (patch) | |
tree | 4bb04769f4b5b9081d4516a4075953fc4c80ec63 /tests | |
parent | e8ab13b3fd8485086c2a906dac85ecc8fa162d84 (diff) | |
download | libgit2-ab96ca5572f1aae6bc7f889fbd46f56fc959ba2b.tar.gz |
Make sure we use the `C` locale for `regcomp` on macOS.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/posix.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/core/posix.c b/tests/core/posix.c index 34a67bf47..4e177b1f9 100644 --- a/tests/core/posix.c +++ b/tests/core/posix.c @@ -11,6 +11,7 @@ #include "clar_libgit2.h" #include "posix.h" +#include "userdiff.h" void test_core_posix__initialize(void) { @@ -39,7 +40,7 @@ void test_core_posix__inet_pton(void) struct in_addr addr; struct in6_addr addr6; size_t i; - + struct in_addr_data { const char *p; const uint8_t n[4]; @@ -146,3 +147,27 @@ void test_core_posix__utimes(void) p_unlink("foo"); } + +void test_core_posix__p_regcomp_compile_single_byte_regexps(void) +{ + regex_t preg; + + cl_must_pass(p_regcomp(&preg, "[\xc0-\xff][\x80-\xbf]", REG_EXTENDED)); + + regfree(&preg); +} + +void test_core_posix__p_regcomp_compile_userdiff_regexps(void) +{ + regex_t preg; + size_t idx; + + for (idx = 0; idx < ARRAY_SIZE(builtin_defs); ++idx) { + git_diff_driver_definition ddef = builtin_defs[idx]; + + cl_must_pass(p_regcomp(&preg, ddef.fns, REG_EXTENDED | ddef.flags)); + cl_must_pass(p_regcomp(&preg, ddef.words, REG_EXTENDED)); + } + + regfree(&preg); +} |