Lp 1730726: Fix lp1501781-unaccent_and_squash.pg for PostgreSQL 9.6
authorJason Stephenson <jason@sigio.com>
Wed, 12 Dec 2018 18:24:01 +0000 (13:24 -0500)
committerBen Shum <ben@evergreener.net>
Fri, 14 Dec 2018 19:36:00 +0000 (14:36 -0500)
PostgreSQL 9.6 apparently exhibits the same behavior as Postgresql 10
when it comes the OE ligature in the unaccent function.  We modify the
test case to take that into account.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Ben Shum <ben@evergreener.net>

Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg

index 3238804..2de74d6 100644 (file)
@@ -54,7 +54,7 @@ SELECT is(evergreen.unaccent_and_squash('El Niño'),
           'elnino', 'Spanish "The Kid"');
 
 SELECT is(evergreen.unaccent_and_squash('Œuvres'),
-          CASE WHEN regexp_replace(regexp_replace(version(),'\..+',''),'^PostgreSQL ','')::INT >= 10 THEN 'oeuvres' ELSE 'euvres' END, 'oe ligature');
+          CASE WHEN substring(version() from '^PostgreSQL ([0-9]+\.[0-9]+)')::DECIMAL > 9.5 THEN 'oeuvres' ELSE 'euvres' END, 'oe ligature');
 
 -- Punctuation Tests