Closes the seven remaining tractable coverage gaps the final review
flagged. All tests-only or tiny *_from variants matching the existing
pattern. 18 new tests.
- src/instance/launch/patches.rs: seven inline tests for the lwjgl3ify
patch helpers that were entirely untested before. strip_replaced_libs
has happy + no-op cases. parse_add_opens covers the basic Add-Opens
extraction, the MANIFEST.MF continuation-line case (the tricky one:
jar manifests wrap lines with a trailing space + leading-space marker
that gets stripped on join), missing manifest, and missing file.
add_lwjgl3 verifies that only jars that actually exist in lib_dir
end up on the classpath.
- src/net/forge.rs: three inline tests for has_legacy_install_profile.
Builds synthetic forge installer zips in a tempdir with and without
the versionInfo key in install_profile.json; covers the missing-jar
branch with a path that doesn't exist.
- src/net/modrinth.rs: five-case rstest for url_encode covering the
unreserved set, space, RFC 3986 reserved characters, multi-byte UTF-8
(the encoder operates per-byte so emoji exercises the multi-byte
path), and empty input.
- src/net/fabric.rs / src/net/quilt.rs: added fetch_*_profile_from and
fetch_*_profile_with_raw_from variants mirroring the existing pattern.
Existing fetch_*_profile and *_with_raw delegate to them with the
upstream constants.
- tests/net_loaders.rs: two new wiremock tests (fabric_fetch_profile
parses libraries, quilt_fetch_profile parses libraries) using the
new _from variants.
- src/tui/widgets/popups/import_modpack/render.rs: extra snapshot for
the Confirm step when loader_version is None (vanilla pack or old
mmc pack). The previous Confirm snapshot covered Some(_) only.
Production touches stay minimal: the four new pub fn delegators in
fabric.rs and quilt.rs, all behaviour-preserving.
Closes the "zero production touches" subset of the deferred coverage
items the audit had flagged.
- src/tui/widgets/popups/new_instance/render.rs: three new snapshots
for the Version, LoaderVersion, and Confirm steps. Each pre-populates
WIZARD_STATE so ensure_versions_loaded and ensure_loader_versions_loaded
short-circuit on LoadState::Loaded and never spawn a network task. The
TEST_SERIAL mutex established in the earlier batch serialises against
the existing Name/Loader snapshots.
- src/tui/widgets/popups/import_modpack/render.rs: two new snapshots
for the Version step (synthetic VersionInfo entries) and the Confirm
step (synthetic ImportSummary). Same serialisation pattern.
- tests/net_mojang.rs: three new wiremock tests.
download_libraries_writes_artifact_to_meta_dir constructs a synthetic
VersionMeta whose single library points at the wiremock server, then
asserts the bytes land at meta_dir/libraries/<artifact.path>.
download_libraries_skips_when_destination_exists verifies the cache
hit path via wiremock's expect(0).
download_assets_writes_index_when_objects_is_empty exercises the
index fetch+write code path with an empty objects map so the per-asset
download loop never fires.
Zero production touches. download_libraries already takes a
VersionMeta whose libraries carry their own URLs; download_assets'
index fetch reads from meta.asset_index.url (also configurable
per-call), so the empty-objects path doesn't need ASSETS_BASE_URL
overridable. Full per-asset coverage lands in a separate commit.