]> git.ipfire.org Git - thirdparty/vim.git/commit
CI(screendump): Support iterative filtering for screendump comparison
authorAliaksei Budavei <0x000c70@gmail.com>
Fri, 25 Jul 2025 18:06:38 +0000 (20:06 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 25 Jul 2025 18:06:38 +0000 (20:06 +0200)
commit624b75a272ccb736a463a2271811644618c3f5ab
treec3878197d23495a714f76d51079cba7acef27461
parent64329714c7ea2b0520c5891f13dc00d1f8e2a41e
CI(screendump): Support iterative filtering for screendump comparison

Before two screendumps are compared for equality by calling
"VerifyScreenDump()", parts of their contents can be omitted
from comparison by executing arbitrary Vim commands written
in a filter file that shares its basename with screendumps.
Sometimes, such filtering can only be too general, as more
context is required in order to decide what parts to touch.
Two new arbitrary functions are therefore hooked in the body
of "VerifyScreenDump()" for the purpose of probing into the
current context and applying iterative filtering as needed.
A paired-up public implementation of each function is also
provided to expedite a workaround for #16559:
------------------------------------------------------------
source util/screendump.vim
let opts = {
    \ 'FileComparisonPreAction':
\ function('g:ScreenDumpDiscardFFFDChars'),
    \ 'NonEqualLineComparisonPostAction':
\ function('g:ScreenDumpLookForFFFDChars'),
\ }
call g:VerifyScreenDump(buf, basename, opts)
------------------------------------------------------------

related: #17704

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/util/screendump.vim