diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-13 02:08:43 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-05-19 11:12:13 +0100 |
commit | 8877d7d3a0a3de9c367e76965588d27930547097 (patch) | |
tree | 554ca6ffc6dc557a64ac0d1aee9ddcfafa0b31b0 | |
parent | ca1b07a200eba27b34bc5b9131867936c5361396 (diff) | |
download | libgit2-8877d7d3a0a3de9c367e76965588d27930547097.tar.gz |
tests: regcomp: use proper character classes
The '[[:digit:]]' and '[[:alpha:]]' classes require double brackets, not
single.
-rw-r--r-- | tests/core/posix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/core/posix.c b/tests/core/posix.c index 4514997d1..a02c8b351 100644 --- a/tests/core/posix.c +++ b/tests/core/posix.c @@ -205,7 +205,7 @@ void test_core_posix__p_regcomp_matches_digits_with_locale(void) try_set_locale(LC_COLLATE); try_set_locale(LC_CTYPE); - cl_assert(!p_regcomp(&preg, "[:digit:]", P_REG_EXTENDED)); + cl_assert(!p_regcomp(&preg, "[[:digit:]]", P_REG_EXTENDED)); str[1] = '\0'; for (c = '0'; c <= '9'; c++) { @@ -224,7 +224,7 @@ void test_core_posix__p_regcomp_matches_alphabet_with_locale(void) try_set_locale(LC_COLLATE); try_set_locale(LC_CTYPE); - cl_assert(!p_regcomp(&preg, "[:alpha:]", REG_EXTENDED)); + cl_assert(!p_regcomp(&preg, "[[:alpha:]]", P_REG_EXTENDED)); str[1] = '\0'; for (c = 'a'; c <= 'z'; c++) { |