diff --git a/test/test_jairee.c b/test/test_jairee.c index 9c4e0aa..98d592c 100644 --- a/test/test_jairee.c +++ b/test/test_jairee.c @@ -32,9 +32,24 @@ static void test_asciiz_string() jairee_string_free(s); } +static void test_basic_re() +{ + jairee_string_t * s = jairee_string_from_asciiz("abcd"); + jairee_re_t * re = jairee_compile(s); + TEST(re != NULL); + TEST(re->error == 0u); + jairee_match_t * match = jairee_matchc(s, 0u, re); + TEST(match != NULL); + TEST(match->start == 0u); + TEST(match->end == 4u); + TEST(match->next == NULL); + jairee_string_free(s); +} + int main(int argc, char * argv[]) { test_asciiz_string(); + test_basic_re(); printf("%d/%d tests passed\n", n_tests_passed, n_tests_passed + n_tests_failed);