Files
BlueArchiveToolkit/adapters/tests/real_addressables_golden.rs
T
nyaKazuha 789402c887 feat: add official resource sync pipeline
Add the production-facing official update service and bat-official-sync watch CLI for unattended resource synchronization.

Support launcher-resource discovery without installing the launcher, remote marker snapshots, local manifest audit and repair, official seed hash validation, bootstrap caching, richer Addressables coverage, SQLite resource persistence, and FFI JSON helpers.
2026-07-05 23:49:56 +08:00

35 lines
1.2 KiB
Rust

use bat_adapters::manifest::ManifestDriverRegistry;
use serde_json::json;
#[tokio::test]
async fn parses_real_shape_addressables_catalog_against_golden() {
let catalog = include_str!("fixtures/real_addressables/catalog.json");
let manifest = ManifestDriverRegistry::with_defaults()
.parse(catalog.as_bytes())
.await
.expect("parse real-shape Addressables catalog");
let actual = json!({
"format": format!("{:?}", manifest.format),
"locator_id": manifest.metadata.locator_id,
"cdn_prefixes": manifest.metadata.cdn_prefixes,
"resource_count": manifest.resources.len(),
"resources": manifest.resources.iter().map(|resource| {
json!({
"path": resource.path,
"hash": resource.hash,
"size": resource.size,
"resource_type": format!("{:?}", resource.resource_type),
"address": resource.address,
"dependencies": resource.dependencies,
})
}).collect::<Vec<_>>(),
"metadata": manifest.metadata.extra,
});
let expected: serde_json::Value =
serde_json::from_str(include_str!("golden/real_addressables.json")).unwrap();
assert_eq!(actual, expected);
}