test: cover the behaviour that has actually broken #27
Loading…
Reference in a new issue
No description provided.
Delete branch "test/behaviour"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
Problem
Every existing spec calls a pure function —
ansi.line,target.parse,status.of,log.parse. Nothing opened a buffer. And every bug found by handrecently was in the untested half: buffer lifecycle, extmarks, navigation.
guh.nvimruns one 863-line spec that drives a real Nvim and makes realghcalls. Same instinct, cheaper transport: these drive real
ci://buffers withthe
ghlayer stubbed, so they are deterministic and need no network.What is covered
Seven cases, each one a regression that actually shipped:
##[endgroup]is gone, stepheaders are added
up,urland its title when the log 404sgStoggles, and survives a reload without going stale-returns to the list you came from, from both a commit and a pull request-falls back to the commit for a job opened by URLThey assert on behaviour, not appearance. No winbar strings, no colours, no
indent widths — those changed on taste half a dozen times recently and would
have cried wolf every time.
The refresh case failed on the first run
A failed refresh was leaving an empty buffer, not the previous text. Nvim
clears a buffer before
BufReadCmdruns — which the comment abovesave_viewhas said all along — so by the time the fetch came back there was nothing left
to keep.
The check in #14 called
fail()directly and never went through:edit, so itproved nothing about the real path. That is the whole argument for these tests
in one example.
Fixed by keeping the lines alongside the view already being saved at the same
moment, and restoring them together: