Description
The Rust resolver currently lacks unit tests. With PRs #2 and #3 adding tests for JavaScript, Python, and Go resolvers, we should complete test coverage for the Rust resolver as well.
Motivation
- Ensures Rust package resolution works correctly
- Prevents regressions in Cargo path parsing
- Maintains consistency with other ecosystem resolvers
- Critical for production readiness
Scope
- Create
pkg/resolver/rust_test.go
- Test Cargo registry path parsing (e.g.,
registry/src/github.com-1ecc6299db9ec823/serde-1.0.130)
- Test version extraction from paths
- Test PURL generation (
pkg:cargo/serde@1.0.130)
- Test edge cases (invalid paths, malformed versions)
- Test package file filtering
- Minimum 5-8 comprehensive test cases
Example Test Cases
- Valid Cargo registry path → correct package info
- Scoped package name handling
- Version extraction from path
- PURL format validation
- Invalid path handling
- Package file filter matching
Description
The Rust resolver currently lacks unit tests. With PRs #2 and #3 adding tests for JavaScript, Python, and Go resolvers, we should complete test coverage for the Rust resolver as well.
Motivation
Scope
pkg/resolver/rust_test.goregistry/src/github.com-1ecc6299db9ec823/serde-1.0.130)pkg:cargo/serde@1.0.130)Example Test Cases