You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2016/06/07 16:28:16 UTC

commons-compress git commit: COMPRESS-351 more tests

Repository: commons-compress
Updated Branches:
  refs/heads/master 11840dfde -> 048b701a9


COMPRESS-351 more tests


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/048b701a
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/048b701a
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/048b701a

Branch: refs/heads/master
Commit: 048b701a9e56755100a17bad712934c1003bbb25
Parents: 11840df
Author: Stefan Bodewig <bo...@apache.org>
Authored: Tue Jun 7 18:27:56 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Tue Jun 7 18:27:56 2016 +0200

----------------------------------------------------------------------
 .../org/apache/commons/compress/ArchiveUtilsTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/048b701a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
index db383ed..875d800 100644
--- a/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
+++ b/src/test/java/org/apache/commons/compress/ArchiveUtilsTest.java
@@ -82,6 +82,19 @@ public class ArchiveUtilsTest extends AbstractTestCase {
         assertEquals(expected, ArchiveUtils.sanitize(input));
     }
 
+    @Test
+    public void sanitizeLeavesShortStringsAlone() {
+        String input = "012345678901234567890123456789012345678901234567890123456789";
+        assertEquals(input, ArchiveUtils.sanitize(input));
+    }
+
+    @Test
+    public void sanitizeRemovesUnprintableCharacters() {
+        String input = "\b12345678901234567890123456789012345678901234567890123456789";
+        String expected = "?12345678901234567890123456789012345678901234567890123456789";
+        assertEquals(expected, ArchiveUtils.sanitize(input));
+    }
+
     private void asciiToByteAndBackOK(final String inputString) {
         assertEquals(inputString, ArchiveUtils.toAsciiString(ArchiveUtils.toAsciiBytes(inputString)));
     }