mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-03 03:10:06 +02:00
gregex: loosen behaviour testing
Circa 8.38, upstream PCRE (intentionally?) changed behaviour with respect to whether options set with expressions like "(?i)" at the top-level were reported via the pcre_fullinfo() API as having been requested during compilation. GLib contained a test that verified that these options were indeed reported as if they had been provided as flags on the API. Remove that check, and document the no-longer-deterministic behaviour. https://bugzilla.gnome.org/show_bug.cgi?id=767240
This commit is contained in:
parent
037719c27c
commit
6d1178b2d9
@ -1582,6 +1582,10 @@ g_regex_get_max_lookbehind (const GRegex *regex)
|
|||||||
*
|
*
|
||||||
* Returns the compile options that @regex was created with.
|
* Returns the compile options that @regex was created with.
|
||||||
*
|
*
|
||||||
|
* Depending on the version of PCRE that is used, this may or may not
|
||||||
|
* include flags set by option expressions such as `(?i)` found at the
|
||||||
|
* top-level within the compiled pattern.
|
||||||
|
*
|
||||||
* Returns: flags from #GRegexCompileFlags
|
* Returns: flags from #GRegexCompileFlags
|
||||||
*
|
*
|
||||||
* Since: 2.26
|
* Since: 2.26
|
||||||
|
@ -2218,17 +2218,16 @@ main (int argc, char *argv[])
|
|||||||
TEST_NEW("(?P<A>x)|(?P<A>y)", G_REGEX_DUPNAMES | G_REGEX_OPTIMIZE, 0);
|
TEST_NEW("(?P<A>x)|(?P<A>y)", G_REGEX_DUPNAMES | G_REGEX_OPTIMIZE, 0);
|
||||||
/* This gives "internal error: code overflow" with pcre 6.0 */
|
/* This gives "internal error: code overflow" with pcre 6.0 */
|
||||||
TEST_NEW("(?i)(?-i)", 0, 0);
|
TEST_NEW("(?i)(?-i)", 0, 0);
|
||||||
|
TEST_NEW ("(?i)a", 0, 0);
|
||||||
|
TEST_NEW ("(?m)a", 0, 0);
|
||||||
|
TEST_NEW ("(?s)a", 0, 0);
|
||||||
|
TEST_NEW ("(?x)a", 0, 0);
|
||||||
|
TEST_NEW ("(?J)a", 0, 0);
|
||||||
|
TEST_NEW ("(?U)[a-z]+", 0, 0);
|
||||||
|
|
||||||
/* Check that flags are correct if the pattern modifies them */
|
|
||||||
/* TEST_NEW_CHECK_FLAGS(pattern, compile_opts, match_ops, real_compile_opts, real_match_opts) */
|
/* TEST_NEW_CHECK_FLAGS(pattern, compile_opts, match_ops, real_compile_opts, real_match_opts) */
|
||||||
TEST_NEW_CHECK_FLAGS ("a", G_REGEX_OPTIMIZE, 0, G_REGEX_OPTIMIZE, 0);
|
TEST_NEW_CHECK_FLAGS ("a", G_REGEX_OPTIMIZE, 0, G_REGEX_OPTIMIZE, 0);
|
||||||
TEST_NEW_CHECK_FLAGS ("a", G_REGEX_RAW, 0, G_REGEX_RAW, 0);
|
TEST_NEW_CHECK_FLAGS ("a", G_REGEX_RAW, 0, G_REGEX_RAW, 0);
|
||||||
TEST_NEW_CHECK_FLAGS ("(?i)a", 0, 0, G_REGEX_CASELESS, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?m)a", 0, 0, G_REGEX_MULTILINE, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?s)a", 0, 0, G_REGEX_DOTALL, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?x)a", 0, 0, G_REGEX_EXTENDED, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?J)a", 0, 0, G_REGEX_DUPNAMES, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?U)[a-z]+", 0, 0, G_REGEX_UNGREEDY, 0);
|
|
||||||
TEST_NEW_CHECK_FLAGS ("(?X)a", 0, 0, 0 /* not exposed by GRegex */, 0);
|
TEST_NEW_CHECK_FLAGS ("(?X)a", 0, 0, 0 /* not exposed by GRegex */, 0);
|
||||||
TEST_NEW_CHECK_FLAGS ("^.*", 0, 0, G_REGEX_ANCHORED, 0);
|
TEST_NEW_CHECK_FLAGS ("^.*", 0, 0, G_REGEX_ANCHORED, 0);
|
||||||
TEST_NEW_CHECK_FLAGS ("(*UTF8)a", 0, 0, 0 /* this is the default in GRegex */, 0);
|
TEST_NEW_CHECK_FLAGS ("(*UTF8)a", 0, 0, 0 /* this is the default in GRegex */, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user