Ejemplo n.º 1
0
TEST(String, MaskToRegex)
{
    POINTERS_EQUAL(NULL, string_mask_to_regex (NULL));
    STRCMP_EQUAL("", string_mask_to_regex (""));
    STRCMP_EQUAL("test", string_mask_to_regex ("test"));
    STRCMP_EQUAL("test.*", string_mask_to_regex ("test*"));
    STRCMP_EQUAL(".*test.*", string_mask_to_regex ("*test*"));
    STRCMP_EQUAL(".*te.*st.*", string_mask_to_regex ("*te*st*"));
    STRCMP_EQUAL("test\\.\\[\\]\\{\\}\\(\\)\\?\\+\\|\\^\\$\\\\",
                 string_mask_to_regex ("test.[]{}()?+|^$\\"));
}
Ejemplo n.º 2
0
TEST(String, MaskToRegex)
{
    char *str;

    WEE_TEST_STR(NULL, string_mask_to_regex (NULL));
    WEE_TEST_STR("", string_mask_to_regex (""));
    WEE_TEST_STR("test", string_mask_to_regex ("test"));
    WEE_TEST_STR("test.*", string_mask_to_regex ("test*"));
    WEE_TEST_STR(".*test.*", string_mask_to_regex ("*test*"));
    WEE_TEST_STR(".*te.*st.*", string_mask_to_regex ("*te*st*"));
    WEE_TEST_STR("test\\.\\[\\]\\{\\}\\(\\)\\?\\+\\|\\^\\$\\\\",
                 string_mask_to_regex ("test.[]{}()?+|^$\\"));
}