Skip to content

[Repo Assist] test: add 6 unit tests for sort-desc, UnpinnedOnly filter, and version edge cases (231→237)#172

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-sort-desc-pinfilter-2026-05-01-df0c0385ae39187e
Draft

[Repo Assist] test: add 6 unit tests for sort-desc, UnpinnedOnly filter, and version edge cases (231→237)#172
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-sort-desc-pinfilter-2026-05-01-df0c0385ae39187e

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 1, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

What

Adds 6 new unit tests in src/app.rs covering previously untested branches in apply_filter and compare_versions. Test count grows from 231 → 237.

New tests

Test What it covers
apply_filter_sort_by_id_desc Descending ID sort: Z.App → M.App → A.App
apply_filter_sort_by_version_desc Descending version sort respects numeric ordering: 10.0 > 2.0 > 1.9
apply_filter_unpinned_only_excludes_pinned PinFilter::UnpinnedOnly removes Blocking-pinned packages
compare_versions_prerelease_beats_older_minor 2.0-beta > 1.9 despite the -beta text suffix on the leading segment
compare_versions_build_metadata_separator + is treated as a separator: 1.0+20240101 > 1.0+20230101
local_filter_returns_empty_when_no_match Filter with no matches yields empty list; selection is clamped to 0

Why

The existing sort tests only covered ascending direction. Descending sort, the UnpinnedOnly pin-filter branch, and version-parsing edge cases (- prerelease and + build-metadata separators) were all untested. These gaps mean a regression in any of these code paths would not be caught by CI.

Test Status

cargo check --all-targets  → clean
cargo fmt -- --check       → clean
cargo clippy -- -D warnings → clean
cargo test                 → 237 passed (was 231) — 6 new tests

Generated by Repo Assist · ● 4.8M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

…n edge cases (231→237)

New tests cover previously untested branches in apply_filter and compare_versions:

- apply_filter_sort_by_id_desc: descending ID sort orders Z→M→A
- apply_filter_sort_by_version_desc: descending version sort respects numeric ordering (10.0 > 2.0 > 1.9)
- apply_filter_unpinned_only_excludes_pinned: UnpinnedOnly filter removes Blocking-pinned packages
- compare_versions_prerelease_beats_older_minor: 2.0-beta > 1.9 despite the text suffix
- compare_versions_build_metadata_separator: + separator is split correctly (1.0+20240101 > 1.0+20230101)
- local_filter_returns_empty_when_no_match: filter with no matches yields empty list, selection clamped to 0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants