Re: daitch_mokotoff module
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dag Lem <dag@nimrod.no>
Cc: Thomas Munro <thomas.munro@gmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-03T16:34:36Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid using non-ASCII commentary in daitch_mokotoff.c.
- 1c54b93a8cf9 16.0 landed
-
Remove some non-ASCII symbols from a comment.
- d6b5dee42de7 16.0 landed
-
Remove useless dependencies in daitch_mokotoff_header.pl.
- 2bfbad9c4220 16.0 landed
-
Pacify perlcritic.
- edc627ae2763 16.0 landed
-
Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch.
- a290378a3752 16.0 landed
-
Enable routine running of citext's UTF8-specific test cases.
- c2e8bd27519f 15.0 landed
Dag Lem <dag@nimrod.no> writes: > Tom Lane <tgl@sss.pgh.pa.us> writes: >> (We do have methods for dealing with non-ASCII test cases, but >> I can't see that this patch is using any of them.) > I naively assumed that tests would be run in an UTF8 environment. Nope, not necessarily. Our current best practice for this is to separate out encoding-dependent test cases into their own test script, and guard the script with an initial test on database encoding. You can see an example in src/test/modules/test_regex/sql/test_regex_utf8.sql and the two associated expected-files. It's a good idea to also cover as much as you can with pure-ASCII test cases that will run regardless of the prevailing encoding. > Running "ack -l '[\x80-\xff]'" in the contrib/ directory reveals that > two other modules are using UTF8 characters in tests - citext and > unaccent. Yeah, neither of those have been upgraded to said best practice. (If you feel like doing the legwork to improve that situation, that'd be great.) > Looking into the unaccent module, I don't quite understand how it will > work with various encodings, since it doesn't seem to decode its input - > will it fail if run under anything but ASCII or UTF8? Its Makefile seems to be forcing the test database to use UTF8. I think this is a less-than-best-practice choice, because then we have zero test coverage for other encodings; but it does prevent test failures. regards, tom lane