fix(tests): exercise the constructors and overwrite branches the tests claimed to cover#77
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two filesys tests were silently testing the wrong thing.
/huntflagged them; this PR fixes both.agent/tests/filesys/file.rs—move_to::src_doesnt_existhad two blocks labeled// overwrite falseand// overwrite true, but both passedOverwrite::Deny. TheOverwrite::Allowbranch (source missing, caller permits overwrite) was never exercised. Changed the second block toOverwrite::Allow.agent/tests/filesys/cached_file.rs—new_with_default::existswas located insidepub mod new_with_defaultbut calledSingleThreadTokenFile::new(file), duplicatingnew::existsand leaving the "existing file beats supplied default" behavior ofnew_with_defaultuncovered. Switched the call toSingleThreadTokenFile::new_with_default(file, Token::default()).Test plan
cargo check --tests -p miru-agent— compiles cleancargo test -p miru-agent --tests filesys::file::move_to::src_doesnt_exist— passescargo test -p miru-agent --tests filesys::cached_file::new_with_default::exists— passes (andexists_invalid_datain the same module still passes)https://claude.ai/code/session_01KQsDGgZLAc5GHhaefjqAr6
Generated by Claude Code