regex test: do not assert that system PCRE still has an 8.31 bug

This was fixed in 8.32, so if we have that version, assert that it is
fixed; if we don't (e.g. the current internal pcre), still don't
assert that it *isn't* fixed.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=733325
Reviewed-by: Christian Persch <chpe@gnome.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Simon McVittie 2015-04-28 10:10:58 +01:00
parent fe1a2dc196
commit ace7846322

View File

@ -25,6 +25,12 @@
#include <locale.h>
#include "glib.h"
#ifdef USE_SYSTEM_PCRE
#include <pcre.h>
#else
#include "glib/pcre/pcre.h"
#endif
/* U+20AC EURO SIGN (symbol, currency) */
#define EURO "\xe2\x82\xac"
/* U+00E0 LATIN SMALL LETTER A WITH GRAVE (letter, lowercase) */
@ -2446,8 +2452,12 @@ main (int argc, char *argv[])
/* Test that othercasing in our pcre/glib integration is bug-for-bug compatible
* with pcre's internal tables. Bug #678273 */
TEST_MATCH("[DŽ]", G_REGEX_CASELESS, 0, "DŽ", -1, 0, 0, TRUE);
TEST_MATCH("[DŽ]", G_REGEX_CASELESS, 0, "Dž", -1, 0, 0, FALSE);
TEST_MATCH("[DŽ]", G_REGEX_CASELESS, 0, "dž", -1, 0, 0, TRUE);
#if PCRE_MAJOR > 8 || (PCRE_MAJOR == 8 && PCRE_MINOR >= 32)
/* This would incorrectly fail to match in pcre < 8.32, so only assert
* this for known-good pcre. */
TEST_MATCH("[DŽ]", G_REGEX_CASELESS, 0, "Dž", -1, 0, 0, TRUE);
#endif
/* TEST_MATCH_NEXT#(pattern, string, string_len, start_position, ...) */
TEST_MATCH_NEXT0("a", "x", -1, 0);