Fix allocation issue in FSA module
This commit is contained in:
@@ -63,6 +63,17 @@ static void test_arbitrary_regex_2(void)
|
||||
fsa_free(&dfa);
|
||||
}
|
||||
|
||||
static void test_system_header_include_regex(void)
|
||||
{
|
||||
fsa_t dfa;
|
||||
const char *regex = "#include <[abcdefghijklmnopqrstuvwxyz]+\\.h>";
|
||||
const bool success = compile(regex, strlen(regex), &dfa);
|
||||
ASSERT_TRUE(success);
|
||||
ASSERT_ACCEPTS(&dfa, "#include <stdio.h>");
|
||||
ASSERT_REJECTS(&dfa, "#include \"foo.h\"");
|
||||
fsa_free(&dfa);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
TESTING_BEGIN();
|
||||
@@ -70,5 +81,6 @@ int main(void)
|
||||
test_even_number_of_Is_regex();
|
||||
test_arbitrary_regex_1();
|
||||
test_arbitrary_regex_2();
|
||||
test_system_header_include_regex();
|
||||
return TESTING_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user