Files
rmcl/src/tui/tests/widgets/popups/modpack_update.rs
T
objz 538c37f853 feat: export modpacks in CurseForge, Modrinth and MultiMC formats
Add shared export planning, cached scans, exact file selection, safe overwrite confirmation and background TUI progress. Refine sectioned confirmations and allow ordinary content changes while games run.

Invalidate stale export fingerprints on validation failure, preserve ownership and mutation checks, and use ordered lookups for unmatched-file highlighting. Add export, UI, locking and cache-recovery regression tests.
2026-10-25 19:12:29 +01:00

43 lines
1.3 KiB
Rust

// SPDX-FileCopyrightText: 2026 Constantin Bauer
// SPDX-License-Identifier: GPL-3.0-only
use super::*;
#[test]
fn review_groups_pack_runtime_and_files_without_losing_versions() {
let summary = crate::instance::import::ImportSummary {
name: "Example Pack".into(),
pack_version: "2.0".into(),
game_version: "1.21.1".into(),
loader: crate::instance::models::ModLoader::Fabric,
loader_version: Some("0.16.0".into()),
mod_count: 42,
override_count: 3,
format: crate::instance::import::PackFormat::Mrpack,
archive_path: "pack.mrpack".into(),
source: None,
};
let lines = review_lines(&summary, "1.0", "2.0");
assert_eq!(lines.len(), 11);
for (index, title) in [(0, "Pack"), (4, "Runtime"), (8, "Files")] {
assert_eq!(lines[index].to_string(), format!(" {title}"));
}
let text = lines
.iter()
.map(Line::to_string)
.collect::<Vec<_>>()
.join("\n");
for value in [
"Example Pack",
"1.0 → 2.0",
"1.21.1",
"Fabric 0.16.0",
"42",
"3",
] {
assert!(text.contains(value));
}
let summary = Paragraph::new(lines).wrap(Wrap { trim: false });
assert_eq!(summary.line_count(66), 11);
}