Add unit tests for uncovered helper methods and edge cases#264
Merged
Conversation
- Add tests for `DependencySpec::is_maven()` (4 cases: both set, maven only, version only, path dep) - Add tests for `Lockfile::has_maven_entry()` (finds maven dep, ignores path deps, returns false for missing) - Add tests for `MavenCoordinate::parse()` edge cases (empty group, empty artifact, empty version, empty packaging) - Add tests for `maven_artifact_url()` (pom and module extensions) - Add test for `cache_path` delegation to `repository_path` - Add tests for `Target::is_host()` (true for host, false for other) - Add test for `Target::display` matches `to_konanc_arg` - Add test for `ensure_plugin_artifacts` locked mode error path - Add test for `map_artifact_download_err` pass-through of other errors 18 new tests across 6 files, covering previously untested branches in the unit-testable code paths. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Adds 18 new unit tests across 6 files, targeting previously untested branches in the unit-testable code. Covers helper methods added in recent refactoring PRs and edge cases in parsing/validation logic.
New tests
manifest.rsDependencySpec::is_maven()— all 4 combinationslockfile.rsLockfile::has_maven_entry()— finds maven, ignores pathmaven.rsparse()empty parts,maven_artifact_url(),cache_pathdelegationtargets/lib.rsis_host()true/false,Displaymatchesto_konanc_argplugin.rsensure_plugin_artifactslocked mode without hasherror.rsmap_artifact_download_errpass-through for non-download errorsCoverage impact
Test plan
cargo test --workspace— 771/771 tests pass (+18 new)cargo clippy --workspace -- -D warnings— 0 warningscargo fmt --all -- --check— clean🤖 Generated with Claude Code