Skip to content

No test suite for the Lua config codebase — critical utility functions have zero automated coverage #163

Description

@ooloth

Current state

No test files of any kind exist in this codebase. Non-trivial production logic in lua/config/util/init.luarequire_all_files_in_config_directory, get_cursor_expression_or_selection, get_system_executable_path, get_formatter_options, get_linter_options, and DAP helpers — has no automated test coverage. The only automated check is StyLua formatting. The headless startup check (nvim --headless -c "qall") exits 0 even on Lua errors (tracked in #141), meaning no green signal is meaningful. Multiple open issues describe confirmed bugs — a crash in send_selection_to_visidata (#90), a mutation bug in get_formatter_options, [d navigating the wrong direction — that tests would have caught before they were committed.

Ideal state

  • A busted or plenary test suite exists and runs in CI (e.g. via nvim-busted-action or plenary.busted)
  • At minimum, lua/config/util/init.lua and lua/config/util/health.lua are covered
  • Edge cases documented in open issues (get_cursor_expression_or_selection discarding multi-line selections, get_formatter_options mutating shared state) are reproduced as failing tests before any fix is written

Out of scope

  • Testing plugin behavior (that belongs to upstream plugin test suites)
  • Testing filetype configs in lua/config/plugins/lang/ (auto-loaded; hard to isolate without a running Neovim instance)

Starting points

  • lua/config/util/init.lua — non-trivial utility functions with no test coverage
  • lua/config/util/health.lua — health check logic; verifiable in isolation
  • .github/workflows/ — where a CI job for the test suite would be added

QA plan

  1. Run the test suite headlessly (e.g. nvim --headless ... with busted or plenary) — expect tests to be collected and exit 0
  2. Introduce a deliberate bug in require_all_files_in_config_directory (e.g. return an empty table) — expect at least one test to fail
  3. Revert the bug — expect the full suite to pass again

Done when

At least lua/config/util/init.lua has a passing test suite that fails when any of its functions are broken.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions