computerline1z / okapi

Automatically exported from code.google.com/p/okapi
0 stars 0 forks source link

TEXTUNIT rule with global cdata generating extra TUs and misordered tags #432

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
attached rule file has commented out TEXTUNIT rules. Uncomment to reproduce 
bug. Here is unit test:
{{{
@Test
    public void testCdataSubfilterEmptyElement() throws Exception {
        URL configUrl = getClass().getResource("/cdataAsHTML.yml");
        URL inputUrl = getClass().getResource("/empty_element.xml");
        RawDocument rd = new RawDocument(inputUrl.toURI(), "UTF-8", locEN);
        List<Event> events = getEvents(filter, rd, configUrl);  
        assertEquals("foobar", 
                     FilterTestDriver.getTextUnit(events, 1).getSource().toString());
        // Make sure there's no "bonus" segment containing the placeholder that
        // references the CDATA
        assertNull(FilterTestDriver.getTextUnit(events, 2));
    }
}}}

Original issue reported on code.google.com by jhargrav...@gmail.com on 20 Jan 2015 at 5:51

Attachments: