From 22af43218a497e6205d921c336db71e9e6959170 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Wed, 28 Mar 2012 15:31:20 +0000 Subject: [PATCH] Don't detect comments except at start of a line git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306422 13f79535-47bb-0310-9956-ffa450edef68 --- src/test/java/org/apache/commons/csv/CSVLexerTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/csv/CSVLexerTest.java b/src/test/java/org/apache/commons/csv/CSVLexerTest.java index 3c81fa7a..a00a40ef 100644 --- a/src/test/java/org/apache/commons/csv/CSVLexerTest.java +++ b/src/test/java/org/apache/commons/csv/CSVLexerTest.java @@ -58,10 +58,10 @@ public class CSVLexerTest { public void testNextToken2() throws IOException { final String code = "1,2,3,\n"+ - "a,b x,c\n"+ + "a,b x,c#no-comment\n"+ "#foo\n"+ "\n"+ - "d,e,\n"+ + "d,e,#no-comment\n"+ "\n"; CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#'); @@ -74,12 +74,12 @@ public class CSVLexerTest { assertTokenEquals(EORECORD, "", parser.nextToken(new Token())); assertTokenEquals(TOKEN, "a", parser.nextToken(new Token())); assertTokenEquals(TOKEN, "b x", parser.nextToken(new Token())); - assertTokenEquals(EORECORD, "c", parser.nextToken(new Token())); + assertTokenEquals(EORECORD, "c#no-comment", parser.nextToken(new Token())); assertTokenEquals(COMMENT, "", parser.nextToken(new Token())); assertTokenEquals(EORECORD, "", parser.nextToken(new Token())); assertTokenEquals(TOKEN, "d", parser.nextToken(new Token())); assertTokenEquals(TOKEN, "e", parser.nextToken(new Token())); - assertTokenEquals(EORECORD, "", parser.nextToken(new Token())); + assertTokenEquals(EORECORD, "#no-comment", parser.nextToken(new Token())); assertTokenEquals(EOF, "", parser.nextToken(new Token())); assertTokenEquals(EOF, "", parser.nextToken(new Token()));