Final-review pass flagged three items. All addressed:
- src/instance/loader/mod.rs: rename and rewrite the two profile-shape
tests so the test name matches what the body does.
legacy_forge_version_info_round_trips_through_save_profile_json was
misleading; the body never called save_installer_profile, it only
wrote bytes to disk and read them back. Renamed to
legacy_forge_version_info_deserialises_as_launch_profile and dropped
the filesystem dance - the test was only ever verifying serde shape
on the literal byte string.
raw_fabric_profile_bytes_parse_as_launch_profile got the same
treatment for consistency: dropped the TempDir + write + read round
trip since the test only checks deserialisation.
- src/tui/error_buffer.rs: removed has_errors_after_push. The test
read global state populated by other tests in the same module, so
it would still pass if push_error were a no-op. The push semantics
are properly covered by peek_all_returns_newest_first and
overflow_drops_oldest, both of which use unique tagged messages to
isolate from cross-test interference.
Audit found 9 confirmed-weak unit tests plus several newly-found ones that
asserted things equivalent to themselves, returned vacuous truth, or had
assertions guarded behind conditionals that silently swallowed failure.
Changes by file:
- auth/accounts.rs: create_offline_account_fields now pins the uuid to
offline_uuid("TestPlayer") instead of !is_empty(); mutating the uuid
derivation would fail this now.
- cli/mod.rs: parses_instance_list_subcommand drills into the list
subcommand under instance rather than only verifying the instance
group exists.
- config/theme.rs: border_style_roundtrip is now an rstest covering all
four BorderStyle variants; mutating any non-Double arm is caught.
- instance/desktop.rs: removed desktop_path_returns_some (assertion was
gated behind if let Some so could pass when the function returned
None); build_content_linux* already covers the real behaviour.
- instance/launch/mod.rs: removed five predicate-only tests that
asserted serde defaulting on LaunchProfile rather than invoking the
migration predicate. Added two tests that actually call
migrate_legacy_meta_if_needed (rstest over modern/legacy arg shapes)
and migrate_legacy_loader_profile_if_needed (modern-with-inheritsFrom
early-return). Renamed build_game_args_renders_upstream_arguments,
dropping the misleading "and appends loader args" clause that the
test never covered.
- instance/loader/mod.rs: removed test_vanilla_install_noop (no
assertion at all) and test_vanilla_get_versions (asserted a hardcoded
Ok(vec!["vanilla"]) return). Replaced test_vanilla_factory with an
rstest covering all five ModLoader variants; a misordered match arm
in get_installer is caught.
- migrate.rs: removed cleanup_instance_leftovers_handles_missing_dir
(had no assertions and was redundant with
cleanup_instance_leftovers_removes_shim_and_log4j).
- net/mod.rs: removed detect_java_falls_back_to_java which asserted
!is_empty() against a function whose worst-case fallback is the
literal string "java"; structurally uncatchable.
- tui/error_buffer.rs: peek_all_returns_newest_first and
auto_assigned_ids_are_unique now tag their pushed events with a
unique substring and filter peek_all_errors to just those, so the
assertions actually fire instead of being silently skipped via
if all.len() >= 2 when shared static state interfered.
Total: net zero change in test count (deletions and parameterised
replacements roughly balance), but mutation coverage of the surviving
suite is materially stronger.
- drop stale phase planning comments from launch_profile module headers.
- simplify merge_libraries to HashSet<&str> (no string clones).
- rewrite coord_key with match_indices (clearer intent).
- read /proc/sys/kernel/osrelease on linux for mojang_os_version
instead of shelling out to uname; return empty elsewhere.
- add comment explaining why is_retryable excludes Parse.
- shorten the launch_profile::... paths in launch/mod.rs with top-level
use statements.
- derive Default on LaunchProfile + nested types so test fixtures use
..Default::default() instead of listing every None field.
- inline account_can_launch at its single call site, delete the helper
and three tests that exercised trivially-correct one-line logic.
- extract get_json_with_raw on HttpClient and save_profile_bytes in
instance::loader; collapses three near-identical fetch_X_profile_with_raw
helpers and three near-identical 'create dir + write bytes' blocks.
several smaller fixes from the code review:
- add os_version to RuleContext + OsCondition for mojang rules that
constrain natives selection by host version (rare, but in the spec).
- factor mojang_os_name/arch/version into a shared launch_profile::system
module instead of duplicating between net/mojang.rs and launch/mod.rs.
- get_json and get_bytes now retry transient failures (5xx, connect,
body decode) via a shared get_with_retry envelope; previously only
download_file had retry logic.
- migrate_legacy_meta_if_needed falls back to the stale cached profile
with a warn log on network failure instead of erroring out (offline
launches now work).
- tightened legacy-loader detection by requiring the unique-to-rmcl
gameArguments field; clearer error when loader_version is absent.
- forge legacy versionInfo write uses compact serialization (no
pretty-print key reorder).
- deleted dead fetch_version_meta and save_profile_json.
- documented quick-play templates omission in templates::lookup.
- added end-to-end test that loads a vanilla profile from disk, loads a
loader profile with inheritsFrom, resolves, renders, and snapshots.
stop re-serializing FabricProfile/QuiltProfile through narrow structs;
new fetch_X_profile_with_raw helpers return both the parsed shape (for
library downloads) and the upstream bytes (written byte-for-byte to the
loader-profiles cache). also fixes a latent issue surfaced by the
change: the legacy-loader migration predicate now skips Fabric and Quilt
explicitly since their upstream shape matches the predicate but they
have no installer JSON to recover from.
install_forge_from_profile now writes the upstream versionInfo as compact
JSON (no key reordering, no field stripping) instead of building a custom
{mainClass, libraries, gameArguments} shape. legacy 1.7.10-era Forge
profiles ride the same LaunchProfile + resolve + render pipeline as
modern Forge. drops the no-longer-needed extract_extra_game_args helper.
stop stripping the installer's version JSON in save_installer_profile -
copy it byte-for-byte so the upstream arguments.jvm (with the
--add-opens flags forge 1.17+ needs on java 17+) reaches launch time.
launch loads the loader profile as LaunchProfile, sets an implicit
inheritsFrom = game_version when absent, resolves through vanilla, then
renders args. classpath assembly unifies into one loop handling both
vanilla-style and loader-style libraries. lazy migration of pre-rework
loader-profiles from the installer's version JSON when still on disk.
fixes the reported Forge 1.17+ on java 17+ IllegalAccessError.
Renames Cargo package, binary, internal path identifiers, java shim,
user-agent, log filename, desktop shortcut Exec lines, and CLI program
name. Wires src/migrate.rs into main() so existing users have their
on-disk data (~/.config/mcl/, ~/.local/share/mcl/, ~/.cache/mcl/) moved
to the new locations on first launch.
BREAKING CHANGE: binary is now named rmcl. Old paths are auto-migrated.
old forge installers don't have --installClient, so we extract the
universal jar and library info directly from install_profile.json
inside the installer jar. also tries multiple maven URL formats since
forge naming is inconsistent across versions.