Skip to content

Commit e940855

Browse files
committed
CSV-35 add test
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306896 13f79535-47bb-0310-9956-ffa450edef68
1 parent a07c9f7 commit e940855

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/test/java/org/apache/commons/csv/CSVLexerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ public void testNextToken3Escaping() throws IOException {
175175
/* file: a,\,,b
176176
* \,,
177177
*/
178-
String code = "a,\\,,b\\\\\n\\,,\\\nc,d\\\n";
179-
CSVFormat format = CSVFormat.DEFAULT.withEscape('\\');
178+
String code = "a,\\,,b\\\\\n\\,,\\\nc,d\\\r\ne";
179+
CSVFormat format = CSVFormat.DEFAULT.withEscape('\\').withEmptyLinesIgnored(false);
180180
assertTrue(format.isEscaping());
181181
Lexer parser = getLexer(code, format);
182182

@@ -185,8 +185,8 @@ public void testNextToken3Escaping() throws IOException {
185185
assertTokenEquals(EORECORD, "b\\", parser.nextToken(new Token()));
186186
assertTokenEquals(TOKEN, ",", parser.nextToken(new Token()));
187187
assertTokenEquals(TOKEN, "\nc", parser.nextToken(new Token()));
188-
assertTokenEquals(EOF, "d\n", parser.nextToken(new Token()));
189-
assertTokenEquals(EOF, "", parser.nextToken(new Token()));
188+
assertTokenEquals(EORECORD, "d\r", parser.nextToken(new Token()));
189+
assertTokenEquals(EOF, "e", parser.nextToken(new Token()));
190190
}
191191

192192
// simple token with escaping enabled

0 commit comments

Comments
 (0)