test: remove redundant coverage

This commit is contained in:
objz committed 2026-07-26 23:57:28 +02:00
1 parent 6138e248cb
commit 6f0825c321
7 files changed
+7 -116

No files matched your search

+3 -14
View File
@@ -196,7 +196,7 @@ mod tests {
use super::*;
#[test]
fn offline_uuid_is_valid_format() {
fn offline_uuid_has_valid_v3_shape() {
let uuid = offline_uuid("Steve");
let parts: Vec<&str> = uuid.split('-').collect();
assert_eq!(parts.len(), 5, "UUID must have 5 dash-separated parts");
@@ -205,19 +205,8 @@ mod tests {
assert_eq!(parts[2].len(), 4);
assert_eq!(parts[3].len(), 4);
assert_eq!(parts[4].len(), 12);
}
#[test]
fn offline_uuid_version_3_marker() {
let uuid = offline_uuid("Steve");
assert!(uuid.split('-').nth(2).unwrap().starts_with('3'));
}
#[test]
fn offline_uuid_variant_bit_set() {
let uuid = offline_uuid("Steve");
let part3 = uuid.split('-').nth(3).unwrap();
let first_nibble = u8::from_str_radix(&part3[..1], 16).unwrap();
assert!(parts[2].starts_with('3'));
let first_nibble = u8::from_str_radix(&parts[3][..1], 16).unwrap();
assert!((0x8..=0xb).contains(&first_nibble));
}
-10
View File
@@ -672,16 +672,6 @@ mod tests {
assert!(mods.is_empty());
}
#[test]
fn scan_mods_finds_jar_files() {
let tmp = tempfile::tempdir().unwrap();
let dir = setup_mods_dir(tmp.path(), "inst");
std::fs::write(dir.join("cool-mod.jar"), b"PK\x03\x04").unwrap();
std::fs::write(dir.join("other-mod.jar.disabled"), b"PK\x03\x04").unwrap();
let mods = scan_mods(tmp.path(), "inst");
assert_eq!(mods.len(), 2);
}
#[test]
fn scan_mods_enabled_disabled_flags() {
let tmp = tempfile::tempdir().unwrap();
+4 -17
View File
@@ -357,22 +357,9 @@ mod tests {
}
#[test]
fn maven_invalid_too_few_parts() {
assert_eq!(maven_coord_to_path("org.example:artifact"), None);
}
#[test]
fn maven_invalid_too_many_parts() {
assert_eq!(maven_coord_to_path("a:b:c:d:e"), None);
}
#[test]
fn maven_invalid_single_part() {
assert_eq!(maven_coord_to_path("just-a-string"), None);
}
#[test]
fn maven_empty_string() {
assert_eq!(maven_coord_to_path(""), None);
fn maven_invalid_coordinates() {
for coordinate in ["org.example:artifact", "a:b:c:d:e", "just-a-string", ""] {
assert_eq!(maven_coord_to_path(coordinate), None);
}
}
}