Skip to content

test: cover build_patch joining two hunks of the same file#83

Merged
wkentaro merged 1 commit into
mainfrom
test/build-patch-same-file-hunks
Jun 26, 2026
Merged

test: cover build_patch joining two hunks of the same file#83
wkentaro merged 1 commit into
mainfrom
test/build-patch-same-file-hunks

Conversation

@wkentaro

Copy link
Copy Markdown
Owner

build_patch collapses multiple hunks of one file under a single diff --git
header, but only the different-files path (test_build_patch_groups_by_file)
was covered. This adds the same-file case, locking that two hunks of one file
produce a single file header with both hunk bodies present.

Test plan

  • uv run pytest tests/unit/_patch_test.py — new test_build_patch_joins_hunks_of_same_file passes; full suite (246) green

@wkentaro wkentaro self-assigned this Jun 25, 2026
@wkentaro

Copy link
Copy Markdown
Owner Author

This was generated by AI during PR processing.

Finalized this tick. Test-only change adding test_build_patch_joins_hunks_of_same_file, which locks the same-file grouping path in build_patch (two hunks of one file collapse under a single diff --git header with both bodies present) — previously only the different-files case (test_build_patch_groups_by_file) was covered.

  • Based on current main HEAD (0 commits behind, no file overlap) → no rebase needed.
  • /code-review (medium): clean, no meaningful findings. Inline diff_output is single-use, consistent with repo scoping conventions.
  • Single well-formed commit → no recommit needed.
  • CI green across all 7 checks (lint + test matrix on ubuntu/macos/windows × py3.10/3.14), merge state CLEAN.

Verdict: recommend-merge.

@wkentaro wkentaro added the recommend-merge pr: Agent finalized and endorses it: review and merge label Jun 25, 2026
@wkentaro

Copy link
Copy Markdown
Owner Author

This was generated by AI during PR processing.

Verdict: recommend-merge

Test-only PR adding test_build_patch_joins_hunks_of_same_file, which covers build_patch grouping two hunks of the same file under a single diff --git header. The test is correct and meaningful: it asserts exactly one file header and that both hunk bodies (+A, +C) are present, exercising the files.setdefault(...) grouping plus "\n".join(h.diff ...) path.

  • /code-review (medium): no findings.
  • Commit history: single clean conventional commit; /recommit no-op.
  • CI: green across all 7 jobs (lint + test on ubuntu/macos/windows × 3.10/3.14).
  • No rebase needed (main gained 0 commits since merge-base; state CLEAN).

No push made this tick, so the existing green CI is authoritative. Ready for maintainer review and merge.

@wkentaro wkentaro added this to the next milestone Jun 26, 2026
@wkentaro wkentaro merged commit 06db86b into main Jun 26, 2026
7 checks passed
@wkentaro wkentaro deleted the test/build-patch-same-file-hunks branch June 26, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recommend-merge pr: Agent finalized and endorses it: review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant