LP1937294: Fix the unaccent and squash tests
authorJason Stephenson <jason@sigio.com>
Fri, 19 Nov 2021 22:44:37 +0000 (17:44 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 23 Mar 2022 22:45:17 +0000 (18:45 -0400)
Changes in Pg 12 and Pg 14 character handling necessitate changes to
two of the tests in t/lp1501781-unaccent_and_squash.pg.  These are
similar to changes made for PostgreSQL 9.6.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg

index 2de74d6..a5e7348 100644 (file)
@@ -30,7 +30,8 @@ SELECT is(evergreen.unaccent_and_squash('0123456789!@#$%^&*()-+'),
           '0123456789', 'Numbers and Symbols');
 
 SELECT is(evergreen.unaccent_and_squash('ÁÉÍÑÓÚÜáéíñóúü¿¡'),
-          'aeinouuaeinouu¿¡', 'Spanish');
+          CASE WHEN substring(version() from '^PostgreSQL ([0-9]+)\.')::INTEGER < 14 THEN 'aeinouuaeinouu¿¡'
+          ELSE 'aeinouuaeinouu?!' END, 'Spanish');
 
 SELECT is(evergreen.unaccent_and_squash('ÖÜÇĞŞöüçğşİI'),
           'oucgsoucgsii', 'Turkish');
@@ -45,7 +46,8 @@ SELECT is(evergreen.unaccent_and_squash('ÁĄÄÉĘĚÍÓÔÚŮÝČĹŇŔŘŠŽ'
           'aaaeeeioouuyclnrrsz', 'Czeck, Slovack & Slovenian');
 
 SELECT is(evergreen.unaccent_and_squash('Άά Έέ Ήή Ίί Όό Ύύ Ώώ'),
-          'άάέέήήίίόόύύώώ', 'Greek');
+          CASE WHEN substring(version() from '^PostgreSQL ([0-9]+)\.')::INTEGER < 12 THEN 'άάέέήήίίόόύύώώ'
+          ELSE 'ααεεηηιιοουυωω' END, 'Greek');
 
 SELECT is(evergreen.unaccent_and_squash('Jacques Bélanger'),
           'jacquesbelanger', 'French nom and prénom');