diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-01 11:49:25 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-01 11:49:25 +0000 |
commit | c8d61cbfe31d0d170cc00d447174bd886faa4ac7 (patch) | |
tree | 83722f62194b19d91ab96a5a28e324c9e487d8cb /poi-scratchpad | |
parent | add71cb80adb570eddfcaf804e89c1c26bc4a38c (diff) | |
download | poi-c8d61cbfe31d0d170cc00d447174bd886faa4ac7.tar.gz poi-c8d61cbfe31d0d170cc00d447174bd886faa4ac7.zip |
code formatting
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad')
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hwpf/usermodel/TestHWPFWrite.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/usermodel/TestHWPFWrite.java b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/usermodel/TestHWPFWrite.java index 36ad393a51..0f2039677a 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hwpf/usermodel/TestHWPFWrite.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hwpf/usermodel/TestHWPFWrite.java @@ -139,4 +139,20 @@ public final class TestHWPFWrite extends HWPFTestCase { assertThrows(IllegalStateException.class, doc::write); } } + + @Test + void testBug65436() throws IOException { + UnsynchronizedByteArrayOutputStream baos = new UnsynchronizedByteArrayOutputStream(); + try (HWPFDocument doc = HWPFTestDataSamples.openSampleFile("SampleDoc.doc")) { + doc + Range r = doc.getRange(); + assertEquals("I am a test document\r", r.getParagraph(0).text()); + doc.write(baos); + } + + try (HWPFDocument doc = new HWPFDocument(baos.toInputStream())) { + Range r = doc.getRange(); + assertEquals("I am a test document\r", r.getParagraph(0).text()); + } + } } |