mirror of
https://github.com/cesanta/slre.git
synced 2025-03-12 16:55:30 +00:00
Check this test.
This commit is contained in:
parent
901d42c33a
commit
fa88964f58
10
unit_test.c
10
unit_test.c
@ -278,6 +278,16 @@ int main(void) {
|
||||
ASSERT(caps[2].ptr[0] == 'z');
|
||||
}
|
||||
|
||||
{
|
||||
/* Valid null-terminating test */
|
||||
static const char * str = ";hello\0\0";
|
||||
static const char * regex = "([^;])";
|
||||
struct slre_cap caps[1];
|
||||
ASSERT(slre_match(regex, str, strlen(str), caps, 1, 0) > 0);
|
||||
printf("%s %d\n", caps[0].ptr, caps[0].len);
|
||||
ASSERT(caps[0].len == 5);
|
||||
}
|
||||
|
||||
printf("Unit test %s (total test: %d, failed tests: %d)\n",
|
||||
static_failed_tests > 0 ? "FAILED" : "PASSED",
|
||||
static_total_tests, static_failed_tests);
|
||||
|
Loading…
Reference in New Issue
Block a user