feat(modpacks): check discovered pack updates

This commit is contained in:
objz committed 2026-08-04 21:32:25 +02:00
1 parent f049904466
commit 695ba5a758
25 files changed
+191 -38

No files matched your search

@@ -42,6 +42,7 @@ fn instance(name: &str, version: &str) -> InstanceConfig {
jvm_args: Vec::new(),
resolution: None,
config_sync_profile: None,
modpack_source: None,
}
}
+3 -24
View File
@@ -15,9 +15,9 @@ use ratatui::{
use super::{
ContentListState, WatcherEventHandling, available_description_width, description_text_width,
diff_directory, diff_event_paths, ellipsize, has_newer_compatible_version,
load_provider_metadata, read_dir_stems, right_aligned_footer_spans, square_icon_columns,
title_suffix_spans, watcher_event_handling, world_descriptions, world_game_mode_color,
diff_directory, diff_event_paths, ellipsize, load_provider_metadata, read_dir_stems,
right_aligned_footer_spans, square_icon_columns, title_suffix_spans, watcher_event_handling,
world_descriptions, world_game_mode_color,
};
fn entry(name: &str) -> ContentEntry {
@@ -695,24 +695,3 @@ async fn provider_metadata_loads_from_cache_without_network() {
assert_eq!(description, "Cached description");
assert!(!update_available);
}
#[test]
fn update_check_requires_the_installed_version_behind_a_newer_result() {
let version = |id: &str| crate::net::modrinth::VersionInfo {
id: id.to_owned(),
project_id: "project".to_owned(),
name: id.to_owned(),
version_number: id.to_owned(),
game_versions: vec!["1.21.1".to_owned()],
loaders: vec!["fabric".to_owned()],
version_type: crate::net::modrinth::VersionType::Release,
dependencies: Vec::new(),
date_published: String::new(),
files: Vec::new(),
};
let versions = vec![version("new"), version("installed")];
assert!(has_newer_compatible_version(&versions, "installed"));
assert!(!has_newer_compatible_version(&versions, "new"));
assert!(!has_newer_compatible_version(&versions, "missing"));
}