Skip to content

test: add decoration provider, integration, and neogit spec files#134

Merged
barrettruth merged 3 commits intomainfrom
test/better-specs
Feb 25, 2026
Merged

test: add decoration provider, integration, and neogit spec files#134
barrettruth merged 3 commits intomainfrom
test/better-specs

Conversation

@barrettruth
Copy link
Owner

Problem

Regressions #119 and #120 showed the test suite had no coverage of the decoration provider cache pipeline, no end-to-end pipeline tests from buffer content to extmarks, and no Neogit-specific integration tests.

Solution

Adds three new spec files (28 new tests, 316 total):

  • spec/decoration_provider_spec.lua — indirect cache pipeline tests via _test table: ensure_cache population, content fingerprint guard, pending_clear semantics, BufWipeout cleanup
  • spec/integration_spec.lua — full pipeline: diff buffer → attach → extmarks; verifies DiffsAdd/DiffsDelete on correct lines, treesitter captures, multi-hunk coverage
  • spec/neogit_integration_spec.luaneogit_disable_hunk_highlight behavior, NeogitStatus/NeogitDiffView attach and cache population, parser neogit filename patterns

Depends on #133.

Closes #122

Problem: diffs.nvim blanked 18 Neogit highlight groups globally on
attach and fell back to getcwd() plus a subprocess call for repo root
detection, with no cache refresh when Neogit lazy-loads new hunks.

Solution: adopt three APIs from Neogit PR #1897:
- set vim.b.neogit_disable_hunk_highlight = true on attach instead
  of overriding 18 hl groups globally
- read vim.b.neogit_git_dir for reliable repo root resolution
- register User NeogitDiffLoaded per-buffer to refresh hunk cache

Closes #128
Problem: regressions #119 and #120 exposed gaps in coverage of the
decoration provider cache pipeline, the end-to-end highlight
pipeline, and Neogit-specific behavior.

Solution: add three spec files covering:
- decoration_provider_spec: cache population, fingerprint guard,
  pending_clear semantics, BufWipeout cleanup via _test table
- integration_spec: full buffer to attach to extmarks pipeline
- neogit_integration_spec: neogit_disable_hunk_highlight and
  filetype attachment

Closes #122
Base automatically changed from feat/neogit-apis to main February 25, 2026 16:43
@barrettruth barrettruth merged commit d797833 into main Feb 25, 2026
7 checks passed
@barrettruth barrettruth deleted the test/better-specs branch February 25, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better Tests

1 participant