Skip to content

fix(tests): exercise the constructors and overwrite branches the tests claimed to cover#77

Merged
ben-miru merged 1 commit into
mainfrom
claude/hunt-repo-agent-ExqCd
May 21, 2026
Merged

fix(tests): exercise the constructors and overwrite branches the tests claimed to cover#77
ben-miru merged 1 commit into
mainfrom
claude/hunt-repo-agent-ExqCd

Conversation

@miru-agents

Copy link
Copy Markdown
Collaborator

Summary

Two filesys tests were silently testing the wrong thing. /hunt flagged them; this PR fixes both.

  • agent/tests/filesys/file.rsmove_to::src_doesnt_exist had two blocks labeled // overwrite false and // overwrite true, but both passed Overwrite::Deny. The Overwrite::Allow branch (source missing, caller permits overwrite) was never exercised. Changed the second block to Overwrite::Allow.
  • agent/tests/filesys/cached_file.rsnew_with_default::exists was located inside pub mod new_with_default but called SingleThreadTokenFile::new(file), duplicating new::exists and leaving the "existing file beats supplied default" behavior of new_with_default uncovered. Switched the call to SingleThreadTokenFile::new_with_default(file, Token::default()).

Test plan

  • cargo check --tests -p miru-agent — compiles clean
  • cargo test -p miru-agent --tests filesys::file::move_to::src_doesnt_exist — passes
  • cargo test -p miru-agent --tests filesys::cached_file::new_with_default::exists — passes (and exists_invalid_data in the same module still passes)

https://claude.ai/code/session_01KQsDGgZLAc5GHhaefjqAr6


Generated by Claude Code

…s claimed to cover

`move_to::src_doesnt_exist` had two blocks labeled "overwrite false" and
"overwrite true" but both passed `Overwrite::Deny`, so the Allow branch
was never tested. `new_with_default::exists` lived in the
`new_with_default` module but called `SingleThreadTokenFile::new`,
duplicating `new::exists` and leaving the "existing file beats default"
behavior of `new_with_default` uncovered.
@ben-miru ben-miru merged commit 672d533 into main May 21, 2026
3 checks passed
@ben-miru ben-miru deleted the claude/hunt-repo-agent-ExqCd branch May 21, 2026 03:17
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.

3 participants