Improve rename and extractor diagnostics

This commit is contained in:
Sucukdeluxe
2026-03-08 22:37:07 +01:00
parent 9fd4dd452a
commit 5ef9575b95
4 changed files with 61 additions and 3 deletions
+8
View File
@@ -5,6 +5,7 @@ import AdmZip from "adm-zip";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import {
buildExternalExtractArgs,
cleanErrorText,
collectArchiveCleanupTargets,
extractPackageArchives,
type ExtractArchiveFailureInfo,
@@ -1038,6 +1039,13 @@ describe("extractor", () => {
it("returns unknown for unrecognized errors", () => {
expect(classifyExtractionError("something weird happened")).toBe("unknown");
});
it("keeps important tail markers when long extractor output is trimmed", () => {
const noisy = `Extracting from archive.rar ${"x".repeat(700)} Unexpected end of archive`;
const cleaned = cleanErrorText(noisy);
expect(cleaned).toContain("Unexpected end of archive");
expect(classifyExtractionError(cleaned)).toBe("missing_parts");
});
});
describe("password discovery", () => {