aboutsummaryrefslogtreecommitdiff
path: root/internal/extract/zipxml_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/extract/zipxml_test.go')
-rw-r--r--internal/extract/zipxml_test.go6
1 files changed, 4 insertions, 2 deletions
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": `<w:document xmlns:w="w"><w:body><w:p><w:r><w:t>good body text</w:t></w:r></w:p></w:body></w:document>`,
"word/footer1.xml": `<w:ftr xmlns:w="w"><w:p><w:r><w:t>broken</w:t></w:r></w:p></w:xyz>`,
}), 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)