* @throws Exception if failed
*/
@Test
public void matrix() throws Exception {
CsvEmitter emitter = createEmitter();
emitter.emit(new StringOption("a-1"));
emitter.emit(new StringOption("a-2"));
emitter.emit(new StringOption("a-3"));
emitter.endRecord();
emitter.emit(new StringOption("b-1"));
emitter.emit(new StringOption("b-2"));
emitter.emit(new StringOption("b-3"));
emitter.endRecord();
emitter.emit(new StringOption("c-1"));
emitter.emit(new StringOption("c-2"));
emitter.emit(new StringOption("c-3"));
emitter.endRecord();
emitter.close();
CsvParser parser = createParser();
assertThat(parser.next(), is(true));
assertThat(fill(parser, new StringOption()), is(new StringOption("a-1")));
assertThat(fill(parser, new StringOption()), is(new StringOption("a-2")));
assertThat(fill(parser, new StringOption()), is(new StringOption("a-3")));
parser.endRecord();
assertThat(parser.next(), is(true));
assertThat(fill(parser, new StringOption()), is(new StringOption("b-1")));
assertThat(fill(parser, new StringOption()), is(new StringOption("b-2")));
assertThat(fill(parser, new StringOption()), is(new StringOption("b-3")));
parser.endRecord();
assertThat(parser.next(), is(true));
assertThat(fill(parser, new StringOption()), is(new StringOption("c-1")));
assertThat(fill(parser, new StringOption()), is(new StringOption("c-2")));
assertThat(fill(parser, new StringOption()), is(new StringOption("c-3")));
parser.endRecord();
assertThat(parser.next(), is(false));
parser.close();
}