Skip to content

Commit 8877d7d

Browse files
committed
tests: regcomp: use proper character classes
The '[[:digit:]]' and '[[:alpha:]]' classes require double brackets, not single.
1 parent ca1b07a commit 8877d7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/core/posix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ void test_core_posix__p_regcomp_matches_digits_with_locale(void)
205205
try_set_locale(LC_COLLATE);
206206
try_set_locale(LC_CTYPE);
207207

208-
cl_assert(!p_regcomp(&preg, "[:digit:]", P_REG_EXTENDED));
208+
cl_assert(!p_regcomp(&preg, "[[:digit:]]", P_REG_EXTENDED));
209209

210210
str[1] = '\0';
211211
for (c = '0'; c <= '9'; c++) {
@@ -224,7 +224,7 @@ void test_core_posix__p_regcomp_matches_alphabet_with_locale(void)
224224
try_set_locale(LC_COLLATE);
225225
try_set_locale(LC_CTYPE);
226226

227-
cl_assert(!p_regcomp(&preg, "[:alpha:]", REG_EXTENDED));
227+
cl_assert(!p_regcomp(&preg, "[[:alpha:]]", P_REG_EXTENDED));
228228

229229
str[1] = '\0';
230230
for (c = 'a'; c <= 'z'; c++) {

0 commit comments

Comments
 (0)