diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-28 13:21:00 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-28 13:21:00 -0500 |
| commit | 4767d16423ff5c87cf1222603c7b8f1b59af8ef2 (patch) | |
| tree | 0b1a8986f8cdd652ca99cef8884170bab5db9ca1 /tests/test-integration-acceptance.el | |
| parent | eb5629570b26b84610ec9ed1a27d40ae5407fca1 (diff) | |
| download | pearl-4767d16423ff5c87cf1222603c7b8f1b59af8ef2.tar.gz pearl-4767d16423ff5c87cf1222603c7b8f1b59af8ef2.zip | |
fix(merge): land the type-nil marker fix that should have been in eb56295
The previous commit (eb56295) shipped the buggy pre-fix version of pearl--merge-issues-into-buffer along with a too-weak test. The intended fix and the strengthened test were sitting uncommitted in the working tree when I ran git commit, because I forgot to re-stage pearl.el and tests/test-pearl-merge.el after addressing the critical correctness finding from pre-commit review. The test that landed asserts each touched marker leads to some LINEAR-ID heading, which passes against the buggy code (the markers point at the wrong heading, but it's still a valid heading).
This commit is the fix and the real test, which together honor what eb56295's message described.
Code change: pearl--merge-issues-into-buffer captures a type-nil copy of the alist marker BEFORE calling pearl--replace-issue-subtree-at-point, instead of pushing the original type-t marker after the replace. The alist marker is insertion-type t (it needs to advance past replaces of EARLIER subtrees so it stays anchored to its own heading), so reusing it after the current subtree's delete-then-insert captures the post-advance position, which is the NEXT subtree's heading. A type-nil copy made before the replace stays anchored at the deletion start and lands on the new heading after the re-insert.
Test change: the returns-touched-markers test now resolves each marker to its heading's LINEAR-ID and asserts the set matches {a, b, c} exactly (for 2 updated + 1 added), instead of just checking each marker reaches some heading. With the buggy code the IDs would resolve to {b, c, c} (a's marker advanced to b's heading, b's marker advanced to c's added heading). The strengthened assertion fails on the bug.
All 674 ert tests pass. make compile and make lint are clean.
Diffstat (limited to 'tests/test-integration-acceptance.el')
0 files changed, 0 insertions, 0 deletions
