Skip to content

Commit b66336c

Browse files
committed
Reduce assumptions about locale's behavior in new regex tests.
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 78a843f to avoid that assumption. We might need to lobotomize them further, but this should be enough to fix the early buildfarm reports.
1 parent 78a843f commit b66336c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ select * from test_regex('[[:alnum:]]*[[:upper:]]*[\u1000-\u2000]*\u1237',
107107
(2 rows)
108108

109109
-- systematically test char classes
110-
select * from test_regex('[[:alnum:]]+', E'x\u1500\u1237', 'L');
110+
select * from test_regex('[[:alnum:]]+', E'x*\u1500\u1237', 'L');
111111
test_regex
112112
-----------------
113113
{0,REG_ULOCALE}
114-
{xᔀሷ}
114+
{x}
115115
(2 rows)
116116

117-
select * from test_regex('[[:alpha:]]+', E'x\u1500\u1237', 'L');
117+
select * from test_regex('[[:alpha:]]+', E'x*\u1500\u1237', 'L');
118118
test_regex
119119
-----------------
120120
{0,REG_ULOCALE}
121-
{xᔀሷ}
121+
{x}
122122
(2 rows)
123123

124124
select * from test_regex('[[:ascii:]]+', E'x\u1500\u1237', 'L');
@@ -197,10 +197,10 @@ select * from test_regex('[[:xdigit:]]+', E'xa9\u1500\u1237', 'L');
197197
{a9}
198198
(2 rows)
199199

200-
select * from test_regex('[[:word:]]+', E'x_\u1500\u1237', 'L');
200+
select * from test_regex('[[:word:]]+', E'x_*\u1500\u1237', 'L');
201201
test_regex
202202
-----------------
203203
{0,REG_ULOCALE}
204-
{x_ᔀሷ}
204+
{x_}
205205
(2 rows)
206206

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ select * from test_regex('[[:alnum:]]*[[:upper:]]*[\u1000-\u2000]*\u1237',
6262
E'\u1500\u1237', 'iELMP');
6363

6464
-- systematically test char classes
65-
select * from test_regex('[[:alnum:]]+', E'x\u1500\u1237', 'L');
66-
select * from test_regex('[[:alpha:]]+', E'x\u1500\u1237', 'L');
65+
select * from test_regex('[[:alnum:]]+', E'x*\u1500\u1237', 'L');
66+
select * from test_regex('[[:alpha:]]+', E'x*\u1500\u1237', 'L');
6767
select * from test_regex('[[:ascii:]]+', E'x\u1500\u1237', 'L');
6868
select * from test_regex('[[:blank:]]+', E'x \t\u1500\u1237', 'L');
6969
select * from test_regex('[[:cntrl:]]+', E'x\u1500\u1237', 'L');
@@ -75,4 +75,4 @@ select * from test_regex('[[:punct:]]+', E'x.\u1500\u1237', 'L');
7575
select * from test_regex('[[:space:]]+', E'x \t\u1500\u1237', 'L');
7676
select * from test_regex('[[:upper:]]+', E'xX\u1500\u1237', 'L');
7777
select * from test_regex('[[:xdigit:]]+', E'xa9\u1500\u1237', 'L');
78-
select * from test_regex('[[:word:]]+', E'x_\u1500\u1237', 'L');
78+
select * from test_regex('[[:word:]]+', E'x_*\u1500\u1237', 'L');

0 commit comments

Comments
 (0)