pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1803293 - /pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
Date Fri, 28 Jul 2017 16:15:18 GMT
Author: tilman
Date: Fri Jul 28 16:15:18 2017
New Revision: 1803293

URL: http://svn.apache.org/viewvc?rev=1803293&view=rev
Log:
PDFBOX-3881: add test

Modified:
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java?rev=1803293&r1=1803292&r2=1803293&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java Fri Jul 28
16:15:18 2017
@@ -353,4 +353,15 @@ public class TestCOSString extends TestC
         assertFalse(test2.equals(test1));
         assertFalse(test1.getString().equals(test2.getString()));
     }
+
+    /**
+     * PDFBOX-3881: Test that if String has only the BOM, that it be an empty string.
+     * 
+     * @throws IOException 
+     */
+    public void testEmptyStringWithBOM() throws IOException
+    {
+        assertTrue(COSString.parseHex("FEFF").getString().isEmpty());
+        assertTrue(COSString.parseHex("FFFE").getString().isEmpty());
+    }
 }



Mime
View raw message