@Test
public void testParseValidUnquotedStrings() {
// check valid strings with out whitespaces and trailing delimiter
byte[] recBytes = "abcdefgh|i|jklmno|".getBytes();
StringValue s = new StringValue();
int startPos = 0;
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 9);
assertTrue(s.getValue().equals("abcdefgh"));
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 11);
assertTrue(s.getValue().equals("i"));
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 18);
assertTrue(s.getValue().equals("jklmno"));
// check single field not terminated
recBytes = "abcde".getBytes();
startPos = 0;
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 5);
assertTrue(s.getValue().equals("abcde"));
// check last field not terminated
recBytes = "abcde|fg".getBytes();
startPos = 0;
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 6);
assertTrue(s.getValue().equals("abcde"));
startPos = parser.parseField(recBytes, startPos, recBytes.length, '|', s);
assertTrue(startPos == 8);
assertTrue(s.getValue().equals("fg"));
}