File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/codec/net Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717
1818package org .apache .commons .codec .net ;
1919
20+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
2021import static org .junit .jupiter .api .Assertions .assertEquals ;
2122import static org .junit .jupiter .api .Assertions .assertNull ;
2223import static org .junit .jupiter .api .Assertions .assertThrows ;
@@ -227,6 +228,15 @@ public void testSoftLineBreakEncode() throws Exception {
227228 assertEquals (qpdata , qpcodec .encode (decoded ));
228229 }
229230
231+ @ Test
232+ public void testTooShortByteArray () {
233+ assertDoesNotThrow (() -> {
234+ final QuotedPrintableCodec qpcodec = new QuotedPrintableCodec (true );
235+ final String qpdata = "AA" ;
236+ assertNull (qpcodec .encode (qpdata ), "Result should be null." );
237+ });
238+ }
239+
230240 @ Test
231241 public void testTrailingSpecial () throws Exception {
232242 final QuotedPrintableCodec qpcodec = new QuotedPrintableCodec (true );
You can’t perform that action at this time.
0 commit comments