not escaping minus in the char set

This commit is contained in:
Sergey Lyubka 2014-02-24 11:24:57 +00:00
parent 5262ccd677
commit 64f6fac81f

View File

@ -63,9 +63,9 @@ int main(void) {
ASSERT(slre_match("^.+$", "", 0, NULL, 0) == SLRE_NO_MATCH);
ASSERT(slre_match("^(.+)$", "", 0, NULL, 0) == SLRE_NO_MATCH);
ASSERT(slre_match("(?i)^([\\+\\-]?)([\\d]+)$", "+", 1,
ASSERT(slre_match("(?i)^([\\+-]?)([\\d]+)$", "+", 1,
caps, 10) == SLRE_NO_MATCH);
ASSERT(slre_match("(?i)^([\\+\\-]?)([\\d]+)$", "+27", 3,
ASSERT(slre_match("(?i)^([\\+-]?)([\\d]+)$", "+27", 3,
caps, 10) == 3);
ASSERT(caps[0].len == 1);
ASSERT(caps[0].ptr[0] == '+');