When merging #1445 we found that the results could be improved.
I promised to fix the deficient results along with proper unit tests so here we go.
Basically utils_strv_shorten_file_list() can repaired and simplified at the same time by a relatively minor change to the supprting utils_strv_find_lcs(). This is all backed up by new unit tests which tests the related functions plus (now reborn) utils_strv_new(). You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2262
-- Commit Summary --
* tests: unit test for some util strv functions * utils: refactor utils_strv_shorten_file_list() and friends * utils: fix suboptimal elipsis substitution by utils_strv_shorten_file_list() * utils: move utils_strv_shorten_file_list() out of GEANY_PRIVATE
-- File Changes --
M src/utils.c (129) M src/utils.h (6) M tests/Makefile.am (11) A tests/test_utils.c (419)
-- Patch Links --
https://github.com/geany/geany/pull/2262.patch https://github.com/geany/geany/pull/2262.diff