feat(discovery): add CurseForge and modpack browsing

This commit is contained in:
objz committed 2026-07-28 14:12:38 +02:00
1 parent 22d5da9f0d
commit 1742f62cd0
38 files changed
+2384 -135

No files matched your search

+15
View File
@@ -1,5 +1,20 @@
use super::*;
#[test]
fn curseforge_fingerprint_ignores_whitespace() {
let temp = tempfile::tempdir().unwrap();
let compact = temp.path().join("compact.jar");
let spaced = temp.path().join("spaced.jar");
std::fs::write(&compact, b"abc").unwrap();
std::fs::write(&spaced, b"a b\nc\r\t").unwrap();
let compact = fingerprint(&compact).unwrap();
assert_eq!(compact.hash("curseforge"), Some("1621425345"));
assert_eq!(
compact.hash("curseforge"),
fingerprint(&spaced).unwrap().hash("curseforge")
);
}
#[test]
fn manifest_round_trip_and_lookup_are_exact() {
let temp = tempfile::tempdir().unwrap();
+11
View File
@@ -89,6 +89,17 @@ fn unchanged_saved_index_reuses_fingerprint_and_skips_provider_query() {
assert_eq!(second.manifest.files[0].fingerprint, fingerprint);
}
#[test]
fn newly_configured_provider_retries_an_unmatched_record() {
let resolution = Resolution::Unmatched {
checked_at: chrono::Utc::now().timestamp(),
providers: vec!["modrinth".to_owned()],
};
assert!(provider_was_not_checked(&resolution, "curseforge"));
assert!(!provider_was_not_checked(&resolution, "modrinth"));
}
#[test]
fn directory_packs_are_indexed_without_provider_queries() {
let temp = tempfile::tempdir().unwrap();