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.[]{}()?+|^$\\")); }
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.[]{}()?+|^$\\")); }