Launcher: the registry pack tests build file URLs with forward slashes, so they pass on Windows
A Windows temp path's backslashes went into the test index's JSON as escapes, so the index failed to parse and the Windows launcher release stopped at its tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -208,6 +208,8 @@ mod tests {
|
||||
zip.write_all(b"renderDistance:8\n").unwrap();
|
||||
zip.finish().unwrap();
|
||||
let size = |p: &Path| fs::metadata(p).unwrap().len();
|
||||
// Forward slashes: a Windows path's backslashes would be escapes in the JSON.
|
||||
let url = |p: &Path| p.display().to_string().replace('\\', "/");
|
||||
let text = format!(
|
||||
r#"{{"schema": 1, "projects": [
|
||||
{{"id": "coords_hud", "kind": "mod", "name": "Coordinates HUD", "summary": "", "license": "MIT",
|
||||
@@ -219,9 +221,9 @@ mod tests {
|
||||
"requires": [{{"id": "coords_hud", "version": "0.1.0", "sha256": "{hmod_sha}"}}],
|
||||
"file": {{"name": "cozy-1.0.0.hpack", "url": "file://{}", "size": {}, "sha256": "{}"}}}}]}}
|
||||
]{extra}}}"#,
|
||||
hmod.display(),
|
||||
url(&hmod),
|
||||
size(&hmod),
|
||||
hpack.display(),
|
||||
url(&hpack),
|
||||
size(&hpack),
|
||||
idx::sha256_file(&hpack).unwrap()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user