{
final String text =
"" + " A. item1\n" + " * item1.1\n" + " * item1.2\n" + " B. item2\n"
+ " i. item2.1\n" + " i. item2.2\n" + " C. item3";
final ByLineSource source = new ByLineReaderSource( new StringReader( text ) );
Block blocks, expected;
expected =
new NumeratedListBlock( Sink.NUMBERING_UPPER_ALPHA, new ListItemBlock[] {
new ListItemBlock( new Block[] { new TextBlock( "item1" ) },
new UnorderedListBlock( new ListItemBlock[] {
new ListItemBlock( new Block[] { new TextBlock( "item1.1" ) } ),
new ListItemBlock( new Block[] { new TextBlock( "item1.2" ) } ) } ) ),
new ListItemBlock( new Block[] { new TextBlock( "item2" ) },
new NumeratedListBlock( Sink.NUMBERING_LOWER_ROMAN, new ListItemBlock[] {
new ListItemBlock( new Block[] { new TextBlock( "item2.1" ) } ),
new ListItemBlock( new Block[] { new TextBlock( "item2.2" ) } ) } ) ),
new ListItemBlock( new Block[] { new TextBlock( "item3" ) } ) } );
blocks = listParser.visit( source.getNextLine(), source );
assertEquals( expected, blocks );
}