gpattern: Move match and match_string functions into GPatternSpec

This allows introspection to properly handle them as GPatternSpec
methods, as per this deprecate g_pattern_match() and
g_pattern_match_string() functions.
This commit is contained in:
Marco Trevisan (Treviño)
2021-04-25 02:33:24 +02:00
parent b8a9f4b436
commit fbb198f968
4 changed files with 89 additions and 12 deletions

View File

@@ -176,10 +176,16 @@ test_match (gconstpointer d)
g_assert_cmpint (g_pattern_match_simple (test->pattern, test->string), ==, test->match);
p = g_pattern_spec_new (test->pattern);
g_assert_cmpint (g_pattern_spec_match_string (p, test->string), ==, test->match);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_assert_cmpint (g_pattern_match_string (p, test->string), ==, test->match);
G_GNUC_END_IGNORE_DEPRECATIONS
r = g_utf8_strreverse (test->string, -1);
g_assert_cmpint (g_pattern_spec_match (p, strlen (test->string), test->string, r), ==, test->match);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_assert_cmpint (g_pattern_match (p, strlen (test->string), test->string, r), ==, test->match);
G_GNUC_END_IGNORE_DEPRECATIONS
g_free (r);
g_pattern_spec_free (p);