test: remove redundant coverage
This commit is contained in:
1 parent
6138e248cb
commit
6f0825c321
7 files changed
+7
-116
No files matched your search
@@ -32,15 +32,6 @@ fn shaders_missing_dir_returns_empty() {
|
||||
assert!(scan_shaders(tmp.path(), "ghost").is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shaders_finds_zip_and_dir() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let dir = setup_subdir(tmp.path(), "inst", "shaderpacks");
|
||||
std::fs::write(dir.join("shader-a.zip"), ZIP_HEADER).unwrap();
|
||||
std::fs::create_dir(dir.join("shader-b")).unwrap();
|
||||
assert_eq!(scan_shaders(tmp.path(), "inst").len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shaders_disabled_variants() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
@@ -81,15 +72,6 @@ fn worlds_missing_dir_returns_empty() {
|
||||
assert!(scan_worlds(tmp.path(), "ghost").is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn worlds_finds_directories() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let dir = setup_subdir(tmp.path(), "inst", "saves");
|
||||
std::fs::create_dir(dir.join("My World")).unwrap();
|
||||
std::fs::create_dir(dir.join("Creative")).unwrap();
|
||||
assert_eq!(scan_worlds(tmp.path(), "inst").len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn worlds_ignores_files() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
@@ -143,15 +125,6 @@ fn resource_packs_missing_dir_returns_empty() {
|
||||
assert!(scan_resource_packs(tmp.path(), "ghost").is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resource_packs_finds_zips_and_dirs() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let dir = setup_subdir(tmp.path(), "inst", "resourcepacks");
|
||||
std::fs::write(dir.join("pack-a.zip"), ZIP_HEADER).unwrap();
|
||||
std::fs::create_dir(dir.join("pack-b")).unwrap();
|
||||
assert_eq!(scan_resource_packs(tmp.path(), "inst").len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resource_packs_disabled_variants() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
|
||||
@@ -278,31 +278,3 @@ async fn download_assets_writes_index_when_objects_is_empty() {
|
||||
serde_json::from_slice(&std::fs::read(&index_path).unwrap()).unwrap();
|
||||
assert!(body.get("objects").is_some());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn fetch_version_manifest_retries_5xx_and_succeeds() {
|
||||
let server = MockServer::start().await;
|
||||
|
||||
// one transient 503 then the real payload; covers the integration of the
|
||||
// retry envelope (already unit-tested in net_retry.rs) with the actual
|
||||
// VersionManifest deserialisation path.
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/manifest.json"))
|
||||
.respond_with(ResponseTemplate::new(503))
|
||||
.up_to_n_times(1)
|
||||
.expect(1)
|
||||
.mount(&server)
|
||||
.await;
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/manifest.json"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(synthetic_manifest()))
|
||||
.expect(1)
|
||||
.mount(&server)
|
||||
.await;
|
||||
|
||||
let url = format!("{}/manifest.json", server.uri());
|
||||
let manifest = fetch_version_manifest_from(&HttpClient::new(), &url)
|
||||
.await
|
||||
.expect("manifest after retry");
|
||||
assert_eq!(manifest.versions.len(), 2);
|
||||
}
|
||||
@@ -32,16 +32,6 @@ fn scan_screenshots_missing_dir_returns_empty() {
|
||||
assert!(screenshots.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scan_screenshots_finds_images() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let dir = setup_screenshots_dir(tmp.path(), "inst");
|
||||
std::fs::write(dir.join("2024-01-01.png"), tiny_png()).unwrap();
|
||||
std::fs::write(dir.join("2024-01-02.png"), tiny_png()).unwrap();
|
||||
let screenshots = scan_screenshots(tmp.path(), "inst");
|
||||
assert_eq!(screenshots.len(), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scan_screenshots_ignores_non_images() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// verifies the lib/main split worked: integration tests can see crate items
|
||||
// through the public API.
|
||||
|
||||
#[test]
|
||||
fn lib_target_is_importable() {
|
||||
// touch one pure function from each major module so the linker fails if
|
||||
// any module went private by mistake during the split.
|
||||
assert!(rmcl::net::maven_coord_to_path("a:b:1.0").is_some());
|
||||
let _ = rmcl::config::SETTINGS.paths.effective_java_path();
|
||||
}
|
||||
Reference in new issue
Block a user