style: remove redundant code narration

This commit is contained in:
objz committed 2026-10-01 13:53:12 +02:00
1 parent 495f31778b
commit 783fb76f06
115 files changed
+19 -746

No files matched your search

@@ -4,7 +4,6 @@
use super::super::packs::extract_description;
use serde_json::json;
// every case exercises a distinct match arm in extract_description.
#[rstest::rstest]
#[case::string(json!("Simple pack"), "Simple pack")]
#[case::object_with_text(json!({"text": "Hello world"}), "Hello world")]
-8
View File
@@ -39,9 +39,6 @@ fn parse_mmc_pack_vanilla() {
assert!(pack.loader().0.is_none());
}
// builds an in-memory mmc-style pack zip and verifies that
// extract_mmc_archive copies only the .minecraft/ subtree into the
// destination, preserving relative paths and skipping siblings.
#[test]
fn extract_mmc_archive_copies_minecraft_subtree() {
use std::io::Write;
@@ -51,9 +48,6 @@ fn extract_mmc_archive_copies_minecraft_subtree() {
let dest = tmp.path().join("instance/.minecraft");
std::fs::create_dir_all(&dest).unwrap();
// Pack/ is the prefix; only .minecraft/ entries should land in dest.
// mmc-style pack: a root dir "Pack/" wrapping the .minecraft tree
// plus a sibling mmc-pack.json that should NOT be extracted.
{
let file = std::fs::File::create(&archive_path).unwrap();
let mut zip = zip::ZipWriter::new(file);
@@ -74,13 +68,11 @@ fn extract_mmc_archive_copies_minecraft_subtree() {
extract_mmc_archive(&archive_path, &dest).expect("extract");
// .minecraft/ entries must have been copied with their relative paths
let options = std::fs::read(dest.join("options.txt")).expect("options.txt");
assert_eq!(options, b"lang:en_us");
let modjar = std::fs::read(dest.join("mods/test-mod.jar")).expect("mods/test-mod.jar");
assert_eq!(modjar, b"jar-bytes");
// and the sibling outside .minecraft/ must not have been copied
assert!(
!dest.join("mmc-pack.json").exists(),
"mmc-pack.json should not land in the instance dir"
-5
View File
@@ -4,8 +4,6 @@
use super::*;
use std::io::Write;
// builds an in-memory zip with the given entries, writes it to tmp, and
// returns the path. shared by parse_add_opens tests.
fn make_zip(tmp: &Path, name: &str, entries: &[(&str, &[u8])]) -> PathBuf {
let path = tmp.join(name);
let file = std::fs::File::create(&path).unwrap();
@@ -29,7 +27,6 @@ fn strip_replaced_libs_removes_dominated_prefixes() {
PathBuf::from("/libs/commons-compress-1.4.1.jar"),
PathBuf::from("/libs/commons-io-2.4.jar"),
PathBuf::from("/libs/guava-15.0.jar"),
// these stay
PathBuf::from("/libs/log4j-core-2.0.jar"),
PathBuf::from("/libs/guava-21.0.jar"),
];
@@ -130,8 +127,6 @@ fn add_lwjgl3_inserts_only_jars_that_exist() {
let mut classpath = vec![PathBuf::from("/leading/forge-patches.jar")];
add_lwjgl3(lib_dir, &mut classpath);
// forge-patches stays at index 0; lwjgl core is inserted at index 1.
// none of the other modules existed so nothing else was added.
assert_eq!(classpath[0], PathBuf::from("/leading/forge-patches.jar"));
assert_eq!(classpath[1], core_jar);
assert_eq!(classpath.len(), 2);
-8
View File
@@ -57,13 +57,6 @@ fn push_and_drain_last_played() {
assert!(drained.iter().any(|(k, _)| k == "run_test_lp"));
}
// Removed drain_empty_returns_empty: it relied on no other test pushing
// to LAST_PLAYED between the two drain calls, which races with the
// parallel push_and_drain_last_played test. The drain semantics are
// already covered by push_and_drain_last_played, which asserts a
// specific entry is present, and the empty-result path is exercised
// implicitly any time drain runs after that test's cleanup.
#[test]
fn send_kill_returns_false_for_missing() {
assert!(!send_kill("run_never_registered_xyz"));
@@ -74,7 +67,6 @@ fn register_and_send_kill() {
let (tx, mut rx) = tokio::sync::oneshot::channel::<()>();
register_kill("run_test_kill", tx);
assert!(send_kill("run_test_kill"));
// the kill signal itself must arrive, not just report success
assert!(rx.try_recv().is_ok());
}