Reduce assumptions about locale's behavior in new regex tests.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Aug 2021 17:00:36 +0000 (13:00 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Aug 2021 17:00:36 +0000 (13:00 -0400)
I was overoptimistic to assume that UTF8-based locales would all
consider U+1500 to be a member of the [[:alpha:]] char class.
Tweak the test cases added by commit 78a843f11 to avoid that
assumption.  We might need to lobotomize them further, but this
should be enough to fix the early buildfarm reports.

src/test/modules/test_regex/expected/test_regex_utf8.out
src/test/modules/test_regex/sql/test_regex_utf8.sql

index 3b56f36c0711e2a44f70531c375e11d17f18a45d..befd75e96f3e280cb0f33212935960f942326134 100644 (file)
@@ -107,18 +107,18 @@ select * from test_regex('[[:alnum:]]*[[:upper:]]*[\u1000-\u2000]*\u1237',
 (2 rows)
 
 -- systematically test char classes
-select * from test_regex('[[:alnum:]]+',  E'x\u1500\u1237', 'L');
+select * from test_regex('[[:alnum:]]+',  E'x*\u1500\u1237', 'L');
    test_regex    
 -----------------
  {0,REG_ULOCALE}
- {xᔀሷ}
+ {x}
 (2 rows)
 
-select * from test_regex('[[:alpha:]]+',  E'x\u1500\u1237', 'L');
+select * from test_regex('[[:alpha:]]+',  E'x*\u1500\u1237', 'L');
    test_regex    
 -----------------
  {0,REG_ULOCALE}
- {xᔀሷ}
+ {x}
 (2 rows)
 
 select * from test_regex('[[:ascii:]]+',  E'x\u1500\u1237', 'L');
@@ -197,10 +197,10 @@ select * from test_regex('[[:xdigit:]]+',  E'xa9\u1500\u1237', 'L');
  {a9}
 (2 rows)
 
-select * from test_regex('[[:word:]]+',  E'x_\u1500\u1237', 'L');
+select * from test_regex('[[:word:]]+',  E'x_*\u1500\u1237', 'L');
    test_regex    
 -----------------
  {0,REG_ULOCALE}
- {x_ᔀሷ}
+ {x_}
 (2 rows)
 
index f23907162e4fdaad422c148b4928fd335842796d..2aa3e0f1022d39d5745e0a339e022216c9e5ace5 100644 (file)
@@ -62,8 +62,8 @@ select * from test_regex('[[:alnum:]]*[[:upper:]]*[\u1000-\u2000]*\u1237',
   E'\u1500\u1237', 'iELMP');
 
 -- systematically test char classes
-select * from test_regex('[[:alnum:]]+',  E'x\u1500\u1237', 'L');
-select * from test_regex('[[:alpha:]]+',  E'x\u1500\u1237', 'L');
+select * from test_regex('[[:alnum:]]+',  E'x*\u1500\u1237', 'L');
+select * from test_regex('[[:alpha:]]+',  E'x*\u1500\u1237', 'L');
 select * from test_regex('[[:ascii:]]+',  E'x\u1500\u1237', 'L');
 select * from test_regex('[[:blank:]]+',  E'x \t\u1500\u1237', 'L');
 select * from test_regex('[[:cntrl:]]+',  E'x\u1500\u1237', 'L');
@@ -75,4 +75,4 @@ select * from test_regex('[[:punct:]]+',  E'x.\u1500\u1237', 'L');
 select * from test_regex('[[:space:]]+',  E'x \t\u1500\u1237', 'L');
 select * from test_regex('[[:upper:]]+',  E'xX\u1500\u1237', 'L');
 select * from test_regex('[[:xdigit:]]+',  E'xa9\u1500\u1237', 'L');
-select * from test_regex('[[:word:]]+',  E'x_\u1500\u1237', 'L');
+select * from test_regex('[[:word:]]+',  E'x_*\u1500\u1237', 'L');