diff options
author | Christian Hergert <chergert@redhat.com> | 2021-07-02 15:22:02 -0700 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2021-07-02 15:22:02 -0700 |
commit | 81c032d781ae7de433cd7e1068ecae373806712f (patch) | |
tree | e1ff5298b4622cea23a1bd8736cf9f70e4860b91 /testsuite | |
parent | 9fec311bb6ab77c08cc8016a1e03d5e0b4fa7f7e (diff) | |
download | gtksourceview-81c032d781ae7de433cd7e1068ecae373806712f.tar.gz |
testsuite: allow testing match flags
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/test-regex.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/testsuite/test-regex.c b/testsuite/test-regex.c index 83a0f639..0a13670e 100644 --- a/testsuite/test-regex.c +++ b/testsuite/test-regex.c @@ -37,7 +37,8 @@ test_slash_c_pattern (void) static void compare_impl_regex_to_g_regex (const char *subject, const char *pattern, - GRegexCompileFlags compile_flags) + GRegexCompileFlags compile_flags, + GRegexMatchFlags match_flags) { GError *err1 = NULL; GError *err2 = NULL; @@ -56,8 +57,8 @@ compare_impl_regex_to_g_regex (const char *subject, ==, impl_regex_get_max_lookbehind (reg2)); - r1 = g_regex_match (reg1, subject, 0, &mi1); - r2 = impl_regex_match (reg2, subject, 0, &mi2); + r1 = g_regex_match (reg1, subject, match_flags, &mi1); + r2 = impl_regex_match (reg2, subject, match_flags, &mi2); g_assert_cmpint (r1, ==, r2); for (;;) @@ -115,26 +116,26 @@ test_compare (void) { /* Note: G_REGEX_OPTIMIZE tests the JIT path in ImplRegex */ - compare_impl_regex_to_g_regex ("aaa\n", "aa", 0); - compare_impl_regex_to_g_regex ("aaa\n", "aa", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("aaa\n", "aa", 0, 0); + compare_impl_regex_to_g_regex ("aaa\n", "aa", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("aaaa\n", "aa", 0); - compare_impl_regex_to_g_regex ("aaaa\n", "aa", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("aaaa\n", "aa", 0, 0); + compare_impl_regex_to_g_regex ("aaaa\n", "aa", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "\\w+", 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "\\w+", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("hello\nworld\n", "\\w+", 0, 0); + compare_impl_regex_to_g_regex ("hello\nworld\n", "\\w+", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*)*", 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*)*", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*)*", 0, 0); + compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*)*", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("aa#bb", "(\\w+)#(\\w+)", 0); - compare_impl_regex_to_g_regex ("aa#bb", "(\\w+)#(\\w+)", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("aa#bb", "(\\w+)#(\\w+)", 0, 0); + compare_impl_regex_to_g_regex ("aa#bb", "(\\w+)#(\\w+)", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("aa#bb cc#dd", "(\\w+)#(\\w+)", 0); - compare_impl_regex_to_g_regex ("aa#bb cc#dd", "(\\w+)#(\\w+)", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("aa#bb cc#dd", "(\\w+)#(\\w+)", 0, 0); + compare_impl_regex_to_g_regex ("aa#bb cc#dd", "(\\w+)#(\\w+)", G_REGEX_OPTIMIZE, 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*\n)*", 0); - compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*\n)*", G_REGEX_OPTIMIZE); + compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*\n)*", 0, 0); + compare_impl_regex_to_g_regex ("hello\nworld\n", "(.*\n)*", G_REGEX_OPTIMIZE, 0); } int |