From 4c8024fb76806726b4652a738e7540260b428473 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Mon, 8 Apr 2013 18:23:32 +0000 Subject: [PATCH] Express intention of tokens in token content and give test more structure git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1465705 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/csv/CSVLexerTest.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/apache/commons/csv/CSVLexerTest.java b/src/test/java/org/apache/commons/csv/CSVLexerTest.java index c4bb0e5a..3f884401 100644 --- a/src/test/java/org/apache/commons/csv/CSVLexerTest.java +++ b/src/test/java/org/apache/commons/csv/CSVLexerTest.java @@ -60,16 +60,13 @@ public class CSVLexerTest { // Single line (without comment) @Test public void testIgnoreSurroundingSpacesAreDeleted() throws IOException { - final String code = "abc,def, hijk, lmnop, qrst,uv ,wxy ,z , ,"; + final String code = "noSpaces, leadingSpaces,trailingSpaces , surroundingSpaces , ,,"; final Lexer parser = getLexer(code, CSVFormat.newBuilder().withIgnoreSurroundingSpaces(true).build()); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "abc")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "def")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "hijk")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "lmnop")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "qrst")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "uv")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "wxy")); - assertThat(parser.nextToken(new Token()), matches(TOKEN, "z")); + assertThat(parser.nextToken(new Token()), matches(TOKEN, "noSpaces")); + assertThat(parser.nextToken(new Token()), matches(TOKEN, "leadingSpaces")); + assertThat(parser.nextToken(new Token()), matches(TOKEN, "trailingSpaces")); + assertThat(parser.nextToken(new Token()), matches(TOKEN, "surroundingSpaces")); + assertThat(parser.nextToken(new Token()), matches(TOKEN, "")); assertThat(parser.nextToken(new Token()), matches(TOKEN, "")); assertThat(parser.nextToken(new Token()), matches(EOF, "")); }