This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e8d3f48 fix and reenable testSkip_RequiredCharsets (#518)
5e8d3f48 is described below

commit 5e8d3f489d8c98594e2e58cbfd612b9581f21791
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Sat Nov 25 14:27:16 2023 +0000

    fix and reenable testSkip_RequiredCharsets (#518)
---
 .../io/input/CharSequenceInputStreamTest.java      | 28 +++++-----------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java 
b/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
index a8e06b81..808ddb67 100644
--- a/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java
@@ -471,32 +471,16 @@ public class CharSequenceInputStreamTest {
         testSingleByteRead(TEST_STRING, UTF_8);
     }
 
-    // This is broken for charsets that don't map each char to a byte
-    private void testSkip(final String csName) throws Exception {
-        try (InputStream r = new CharSequenceInputStream("test", csName)) {
-            assertEquals(1, r.skip(1));
-            assertEquals(2, r.skip(2));
-            assertEquals('t', r.read(), csName);
-            r.skip(100);
-            assertEquals(-1, r.read(), csName);
-        }
-    }
 
     @Test
-    @Disabled // test is broken for charsets that generate multiple bytes per 
char.
     public void testSkip_RequiredCharsets() throws Exception {
         for (final String csName : getRequiredCharsetNames()) {
-            testSkip(csName);
+            try (InputStream r = new CharSequenceInputStream("test", csName)) {
+                assertEquals(1, r.skip(1));
+                assertEquals(2, r.skip(2));
+                r.skip(100);
+                assertEquals(-1, r.read(), csName);
+            }
         }
     }
-
-    @Test
-    public void testSkip_USASCII() throws Exception {
-        testSkip("US-ASCII");
-    }
-
-    @Test
-    public void testSkip_UTF8() throws Exception {
-        testSkip(UTF_8);
-    }
 }

Reply via email to