Skip to content

Commit 4c8024f

Browse files
committed
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
1 parent 1c728b4 commit 4c8024f

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,13 @@ private Lexer getLexer(final String input, final CSVFormat format) {
6060
// Single line (without comment)
6161
@Test
6262
public void testIgnoreSurroundingSpacesAreDeleted() throws IOException {
63-
final String code = "abc,def, hijk, lmnop, qrst,uv ,wxy ,z , ,";
63+
final String code = "noSpaces, leadingSpaces,trailingSpaces , surroundingSpaces , ,,";
6464
final Lexer parser = getLexer(code, CSVFormat.newBuilder().withIgnoreSurroundingSpaces(true).build());
65-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "abc"));
66-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "def"));
67-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "hijk"));
68-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "lmnop"));
69-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "qrst"));
70-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "uv"));
71-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "wxy"));
72-
assertThat(parser.nextToken(new Token()), matches(TOKEN, "z"));
65+
assertThat(parser.nextToken(new Token()), matches(TOKEN, "noSpaces"));
66+
assertThat(parser.nextToken(new Token()), matches(TOKEN, "leadingSpaces"));
67+
assertThat(parser.nextToken(new Token()), matches(TOKEN, "trailingSpaces"));
68+
assertThat(parser.nextToken(new Token()), matches(TOKEN, "surroundingSpaces"));
69+
assertThat(parser.nextToken(new Token()), matches(TOKEN, ""));
7370
assertThat(parser.nextToken(new Token()), matches(TOKEN, ""));
7471
assertThat(parser.nextToken(new Token()), matches(EOF, ""));
7572
}

0 commit comments

Comments
 (0)