Skip to content

Commit

Permalink
fix: fix manually installed sort will include all uninstalled packages (
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish authored Dec 18, 2024
1 parent 75f8ba8 commit 59e10df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl PackageSort {
/// Only packages that are manually installed will be included.
pub fn manually_installed(mut self) -> Self {
self.auto_installed = Sort::Reverse;
self.installed = Sort::Enable;
self
}

Expand Down
11 changes: 11 additions & 0 deletions tests/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ mod cache {
}
}

#[test]
fn manually_installed() {
let cache = new_cache!().unwrap();

let sort = PackageSort::default().manually_installed().names();

for pkg in cache.packages(&sort) {
println!("{}", pkg.name())
}
}

#[test]
fn time_cache_iter() {
let cache = new_cache!().unwrap();
Expand Down

0 comments on commit 59e10df

Please sign in to comment.