diff --git a/launcher/src/browser/horizon/pack.rs b/launcher/src/browser/horizon/pack.rs index 73dcd0cc1..a2cc4d079 100644 --- a/launcher/src/browser/horizon/pack.rs +++ b/launcher/src/browser/horizon/pack.rs @@ -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() );