Skip to content

test: make constructor rename regression assertions unconditional #1589

Description

@shunichironomura

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Review finding: M01 · Priority: P3

crates/graphcal-lsp/src/rename.rs:893–918 wraps its checks in if let Ok(Some(result)) = rename(...). Returning an error or no edit makes the test pass. It also constructs and immediately discards a LineIndex (let _ = lines).

Require successful rename with an explicit assertion, check exactly the intended spans, apply the edit, and compile the result. Remove the unused index construction. This should be done with the #1580/#1581 regression work, not as an unrelated broad style refactor.

Acceptance criteria

  • rename_constructor_edits_all_occurrences explicitly requires Ok(Some(edit)); an error or absent edit fails the test.
  • Assert exactly the intended definition, initializer, and match-arm spans, not merely a lower bound on the edit count.
  • Apply the edits and verify the resulting source checks successfully.
  • Remove the unused LineIndex construction and discard.

Sequencing

Coordinate with #1580 and #1581 to strengthen the rename regression suite. This test cleanup is independently implementable and should not require a broad style refactor.

Review context

Identified during the 2026-09-06 codebase review at workspace commit 7f2944b3d0d3d5a95cf1c10b7ad1ba7bb80228a4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions