Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5218#discussion_r159127981 --- Diff: flink-core/src/test/java/org/apache/flink/types/parser/FieldParserTest.java --- @@ -43,4 +43,38 @@ public void testEndsWithDelimiter() throws Exception { assertFalse(FieldParser.endsWithDelimiter(bytes, 3, delim)); } + @Test + public void testNextStringEndPos() throws Exception { + byte[] bytes = "a|c".getBytes(); + byte[] delim = "|".getBytes(); + FieldParser parser = new TestFieldParser<String>(); + + assertEquals(1, parser.nextStringEndPos(bytes, 0, 3, delim)); + assertEquals(-1, parser.nextStringEndPos(bytes, 3, 3, delim)); --- End diff -- add an assertion that the error state was correctly set
---