示例#1
0
 private void assertNextToken(CSVTokenizer tokenizer, CSVTokenType tokenType, String cell)
     throws IOException {
   CSVTokenType found = tokenizer.next();
   assertEquals(tokenType, found);
   assertEquals(tokenType, tokenizer.ttype);
   assertEquals(cell, tokenizer.cell);
 }
示例#2
0
 @Test
 public void testSkipLine() throws IOException {
   // testing \r
   CSVTokenizer tokenizer = createTokenizer("1\r2");
   tokenizer.skipLine();
   assertNextToken(tokenizer, CELL, "2");
   assertNextToken(tokenizer, EOF, null);
   // testing \n
   tokenizer = createTokenizer("1\r\n2");
   tokenizer.skipLine();
   assertNextToken(tokenizer, CELL, "2");
   assertNextToken(tokenizer, EOF, null);
   // testing \r\n
   tokenizer = createTokenizer("1\n2");
   tokenizer.skipLine();
   assertNextToken(tokenizer, CELL, "2");
   assertNextToken(tokenizer, EOF, null);
 }