Skip to content

test: add describe_operation tests for PatchApply variants#608

Merged
SebTardif merged 2 commits into
mainfrom
fix/improve-cycle-1
Jun 17, 2026
Merged

test: add describe_operation tests for PatchApply variants#608
SebTardif merged 2 commits into
mainfrom
fix/improve-cycle-1

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Add 6 unit tests for the describe_operation function in explain.rs:

  • describe_patch_apply_default: verifies static string for default PatchApply
  • describe_patch_apply_merge_on_stale: verifies "merge on stale" suffix
  • describe_patch_apply_allow_conflicts: verifies "allow conflicts" suffix
  • describe_patch_apply_merge_and_conflicts: verifies both combined
  • describe_replace_glob_no_path: verifies glob fallback in Replace describe
  • describe_replace_delete_mode: verifies to: None shows "(delete)"

Also fixes the PatchApply variant to actually include on_stale and allow_conflicts in the describe output when non-default, matching the behavior of other operation variants.

The explain command's describe_operation for PatchApply was a static
string that ignored on_stale and allow_conflicts parameters added in
#587/#602. Fixed the description to include these when non-default,
and added 6 new tests covering:
- PatchApply default, merge-on-stale, allow-conflicts, both
- Replace with glob instead of path
- Replace with to: None (delete mode)

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif SebTardif enabled auto-merge (squash) June 17, 2026 02:59
@SebTardif SebTardif merged commit 70d0ce0 into main Jun 17, 2026
38 checks passed
@SebTardif SebTardif deleted the fix/improve-cycle-1 branch June 17, 2026 03:29
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.

1 participant