Skip to content

test: add unit tests for act refactor test-helper functions #133

Description

@coderabbitai

Background

PR #127 (Remove refactor helper dead-code witnesses) introduced shared test helpers in crates/weaverd/src/dispatch/act/refactor/refactor_helpers.rs but added only lint-compliance meta-tests. The helper functions themselves have no dedicated unit or behavioural tests.

Required work

Add unit tests (inside a #[cfg(test)] block within refactor_helpers.rs or as a dedicated integration test) that cover the following:

  • builders::command_request — verifies domain, operation, and argument fields are set correctly.
  • builders::build_backends — verifies the returned backends are constructed without panicking.
  • builders::configure_request — verifies in-place mutation replaces all fields.
  • content::classify_file — covers .py, .rs, and an unrecognised extension.
  • content::original_content_for / updated_content_for — spot-checks known values per file kind.
  • content::routed_patch_path — verifies routing for Python, Rust, and Other kinds.
  • content::routed_diff_for / routed_malformed_diff_for — verifies well-formed vs malformed diff headers.
  • resolutions::rejected_candidate — verifies fields are populated correctly.
  • resolutions::resolve_auto_language — covers the Some (selected) and None (refused) branches.

Context

Raised during review of PR #127 by @coderabbitai.
Requested by @leynos.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions