t1.set(0, "123 456\"789");
Tuple t2 = tf.newTuple(1);
t2.set(0, null);
Tuple t3 = tf.newTuple(0);
TOKENIZE f = new TOKENIZE();
DataBag b = f.exec(t1);
assertTrue(b.size()==3);
Iterator<Tuple> i = b.iterator();
Tuple rt = i.next();
assertTrue(rt.get(0).equals("123"));
rt = i.next();
assertTrue(rt.get(0).equals("456"));
rt = i.next();
assertTrue(rt.get(0).equals("789"));
// Check when delim specified
Tuple t4 = tf.newTuple(2);
t4.set(0, "123|456|78\"9");
t4.set(1, "|");
b = f.exec(t4);
assertTrue(b.size()==3);
i = b.iterator();
rt = i.next();
assertTrue(rt.get(0).equals("123"));
rt = i.next();
assertTrue(rt.get(0).equals("456"));
rt = i.next();
assertTrue(rt.get(0).equals("78\"9"));
b = f.exec(t2);
assertTrue(b==null);
b = f.exec(t3);
assertTrue(b==null);
}