2727
2828public class CSVLexerTest {
2929
30- private CSVLexer getLexer (String input , CSVFormat format ) {
30+ private Lexer getLexer (String input , CSVFormat format ) {
3131 return new CSVLexer (format , new ExtendedBufferedReader (new StringReader (input )));
3232 }
3333
@@ -40,7 +40,7 @@ private void assertTokenEquals(Token.Type expectedType, String expectedContent,
4040 @ Test
4141 public void testNextToken1 () throws IOException {
4242 String code = "abc,def, hijk, lmnop, qrst,uv ,wxy ,z , ," ;
43- CSVLexer parser = getLexer (code , CSVFormat .DEFAULT .withSurroundingSpacesIgnored (true ));
43+ Lexer parser = getLexer (code , CSVFormat .DEFAULT .withSurroundingSpacesIgnored (true ));
4444 assertTokenEquals (TOKEN , "abc" , parser .nextToken (new Token ()));
4545 assertTokenEquals (TOKEN , "def" , parser .nextToken (new Token ()));
4646 assertTokenEquals (TOKEN , "hijk" , parser .nextToken (new Token ()));
@@ -66,7 +66,7 @@ public void testNextToken2() throws IOException {
6666 String code = "1,2,3,\n a,b x,c\n #foo\n \n d,e,\n \n " ;
6767 CSVFormat format = CSVFormat .DEFAULT .withCommentStart ('#' );
6868
69- CSVLexer parser = getLexer (code , format );
69+ Lexer parser = getLexer (code , format );
7070
7171
7272 assertTokenEquals (TOKEN , "1" , parser .nextToken (new Token ()));
@@ -93,7 +93,7 @@ public void testNextToken3() throws IOException {
9393 */
9494 String code = "a,\\ ,,b\n \\ ,," ;
9595 CSVFormat format = CSVFormat .DEFAULT .withCommentStart ('#' );
96- CSVLexer parser = getLexer (code , format );
96+ Lexer parser = getLexer (code , format );
9797
9898 assertTokenEquals (TOKEN , "a" , parser .nextToken (new Token ()));
9999 // an unquoted single backslash is not an escape char
@@ -115,7 +115,7 @@ public void testNextToken4() throws IOException {
115115 * a, " foo " ,b
116116 */
117117 String code = "a,\" foo\" ,b\n a, \" foo\" ,b\n a,\" foo \" ,b\n a, \" foo \" ,b" ;
118- CSVLexer parser = getLexer (code , CSVFormat .DEFAULT .withSurroundingSpacesIgnored (true ));
118+ Lexer parser = getLexer (code , CSVFormat .DEFAULT .withSurroundingSpacesIgnored (true ));
119119 assertTokenEquals (TOKEN , "a" , parser .nextToken (new Token ()));
120120 assertTokenEquals (TOKEN , "foo" , parser .nextToken (new Token ()));
121121 assertTokenEquals (EORECORD , "b" , parser .nextToken (new Token ()));
@@ -135,7 +135,7 @@ public void testNextToken4() throws IOException {
135135 @ Test
136136 public void testNextToken5 () throws IOException {
137137 String code = "a,\" foo\n \" ,b\n \" foo\n baar ,,,\" \n \" \n \t \n \" " ;
138- CSVLexer parser = getLexer (code , CSVFormat .DEFAULT );
138+ Lexer parser = getLexer (code , CSVFormat .DEFAULT );
139139 assertTokenEquals (TOKEN , "a" , parser .nextToken (new Token ()));
140140 assertTokenEquals (TOKEN , "foo\n " , parser .nextToken (new Token ()));
141141 assertTokenEquals (EORECORD , "b" , parser .nextToken (new Token ()));
@@ -154,7 +154,7 @@ public void testNextToken6() throws IOException {
154154 */
155155 String code = "a;'b and '' more\n '\n !comment;;;;\n ;;" ;
156156 CSVFormat format = CSVFormat .DEFAULT .withDelimiter (';' ).withEncapsulator ('\'' ).withCommentStart ('!' );
157- CSVLexer parser = getLexer (code , format );
157+ Lexer parser = getLexer (code , format );
158158 assertTokenEquals (TOKEN , "a" , parser .nextToken (new Token ()));
159159 assertTokenEquals (EORECORD , "b and ' more\n " , parser .nextToken (new Token ()));
160160 }
@@ -163,7 +163,7 @@ public void testNextToken6() throws IOException {
163163 @ Test
164164 public void testDelimiterIsWhitespace () throws IOException {
165165 String code = "one\t two\t \t four \t five\t six" ;
166- CSVLexer parser = getLexer (code , CSVFormat .TDF );
166+ Lexer parser = getLexer (code , CSVFormat .TDF );
167167 assertTokenEquals (TOKEN , "one" , parser .nextToken (new Token ()));
168168 assertTokenEquals (TOKEN , "two" , parser .nextToken (new Token ()));
169169 assertTokenEquals (TOKEN , "" , parser .nextToken (new Token ()));
0 commit comments