[PATCH] contrib/fuzzystrmatch: improve test coverage

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] contrib/fuzzystrmatch: improve test coverage
Date: 2026-11-02 07:40:02
Message-ID: CAJ7c6TMyroie8iW=AHy3n+U2GoNO9Pr+C0XFNU6Qrgz=6JiaKA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I noticed that contrib/fuzzystrmatch has poor test coverage. The
proposed patch fixes [1] this:

dmetaphone.c: 17.8% -> 94.9%
fuzzystrmatch.c: 49.5% -> 98.9%
daitch_mokotoff.c: 95.7% -> 98.8%

Feedback is most welcome.

### Note for the reviewers ###

You can verify the patch like this (change -Dprefix):

$ time -p sh -c 'git clean -df && (rm -r build || true) && meson setup
--buildtype debug -Db_coverage=true -Dcassert=true
-Dinjection_points=true -Dtap_tests=enabled -Dldap=disabled
-Dicu=disabled -DPG_TEST_EXTRA="kerberos ldap libpq_encryption
load_balance oauth regress_dump_restore ssl wal_consistency_checking
xid_wraparound" -Dprefix=/home/eax/pginstall build && ninja -C build
&& meson test -j 8 -C build && ninja -j 8 -C build coverage-html &&
open build/meson-logs/coveragereport/contrib/fuzzystrmatch/index.html'

Better to use lcov <= 1.16. We had some problems with newer versions
last time I checked.

[1]: https://gist.github.com/afiskon/b26d9b3e46524ba16d8f4ba9004cea66

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v1-0001-contrib-fuzzystrmatch-imporve-test-coverage.patch text/x-patch 16.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Ziming Zhang 2026-11-02 07:51:53 Re: [PATCH] Combine qual-based and NOT NULL proofs when reducing outer joins
Previous Message Michael Paquier 2026-11-02 07:38:13 Re: Reject access to unlogged tables in contrib modules