From 64f6fac81ff174af47679301d643210e46b041e8 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 24 Feb 2014 11:24:57 +0000 Subject: [PATCH] not escaping minus in the char set --- unit_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unit_test.c b/unit_test.c index c5e64b3..8f1f0b2 100644 --- a/unit_test.c +++ b/unit_test.c @@ -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] == '+');