Mechanical cleanup pass, behavior-preserving: - remove dead code: reposition_bars (unused), sbar click infrastructure (zones never populated, handler iterated empty list) - extract helpers in mode.lua: win_ok, buf_ok, is_dapui_pane_ft, for_each_dapui_pane (asymmetric filter preserved), safe_extmark, bar_set_lines, safe_set_height, if_still_active, invalidate_dead_bars, focus_source_win, unset_and_restore - inline install_cs_listener inside define_highlights to dedup the three ColorScheme augroup+autocmd triples (italic, key, sep) - data-drive sign_define in breakpoints.lua - data-drive python interpreter candidate probing - add tests/test_render_bars.lua pinning sbar/cbar output dimensions, zones, and overflow fallback behavior - add tests/test_highlights_cs.lua verifying ColorScheme augroups and highlight group existence / re-apply on event - add tests/test_helpers.lua unit-testing keyof and source_window - expose M._test (direct function refs) so render/highlight internals are testable in headless mode
22 lines
465 B
Lua
22 lines
465 B
Lua
local M = {}
|
|
|
|
function M.assert_eq(a, b, msg)
|
|
if a ~= b then
|
|
error(string.format("FAIL: %s — expected %s, got %s", msg, vim.inspect(b), vim.inspect(a)))
|
|
end
|
|
end
|
|
|
|
function M.assert_true(v, msg)
|
|
if not v then
|
|
error(string.format("FAIL: %s — expected truthy, got %s", msg, vim.inspect(v)))
|
|
end
|
|
end
|
|
|
|
function M.assert_false(v, msg)
|
|
if v then
|
|
error(string.format("FAIL: %s — expected falsy, got %s", msg, vim.inspect(v)))
|
|
end
|
|
end
|
|
|
|
return M
|