[PATCH] contrib/fuzzystrmatch: improve test coverage

Started by Aleksander Alekseev3 days ago1 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@tigerdata.com

Hi,

I noticed that contrib/fuzzystrmatch has poor test coverage. The
proposed patch fixes [1]https://gist.github.com/afiskon/b26d9b3e46524ba16d8f4ba9004cea66 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

Attachments:

t254512_1
v1-0001-contrib-fuzzystrmatch-imporve-test-coverage.patchtext/x-patch; charset=US-ASCII; name=v1-0001-contrib-fuzzystrmatch-imporve-test-coverage.patchDownload+434-1