Commit 8877d7d3a0a3de9c367e76965588d27930547097

Edward Thomson 2019-01-13T02:08:43

tests: regcomp: use proper character classes The '[[:digit:]]' and '[[:alpha:]]' classes require double brackets, not single.

diff --git a/tests/core/posix.c b/tests/core/posix.c
index 4514997..a02c8b3 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++) {