From c09020c2fb01da24d5befbed78ce3b73b5efbe4c Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 23:39:37 +0200 Subject: content tests are three-valued: unknown when unreadable or read in part --- internal/extract/zipxml_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/extract/zipxml_test.go') diff --git a/internal/extract/zipxml_test.go b/internal/extract/zipxml_test.go index 14ead80..30a4cf9 100644 --- a/internal/extract/zipxml_test.go +++ b/internal/extract/zipxml_test.go @@ -138,8 +138,10 @@ func TestZipLenientOnMalformedEntry(t *testing.T) { "word/document.xml": `good body text`, "word/footer1.xml": `broken`, }), 0) - if err != nil { - t.Fatalf("good entry alongside a malformed one: %v", err) + // Partly read: the text is kept, and ErrPartial says some of it is + // missing, so a keyword not found in it is unknown (plan 11). + if !errors.Is(err, ErrPartial) { + t.Fatalf("good entry alongside a malformed one: err %v, want ErrPartial", err) } if !strings.Contains(got, "good body text") { t.Errorf("text from the good entry was discarded: %q", got) -- cgit v1.3