Search in sources :

Example 1 with ILIASFilter

use of org.omegat.filters2.text.ilias.ILIASFilter in project omegat by omegat-org.

the class ILIASFilterTest method testAlign.

@Test
public void testAlign() throws Exception {
    final AlignResultHolder alignResult = new AlignResultHolder();
    align(new ILIASFilter(), "ilias/ILIASFilterAlign.lang", "ilias/ILIASFilterAlign-tr.lang", new IAlignCallback() {

        @Override
        public void addTranslation(String id, String source, String translation, boolean isFuzzy, String comment, IFilter filter) {
            alignResult.aligned = id.equals("module_name#:#variable_name") && source.equals("original") && translation.equals("translated");
        }
    });
    assertTrue(alignResult.aligned);
}
Also used : IFilter(org.omegat.filters2.IFilter) ILIASFilter(org.omegat.filters2.text.ilias.ILIASFilter) IAlignCallback(org.omegat.filters2.IAlignCallback) Test(org.junit.Test)

Example 2 with ILIASFilter

use of org.omegat.filters2.text.ilias.ILIASFilter in project omegat by omegat-org.

the class ILIASFilterTest method testParse.

@Test
public void testParse() throws Exception {
    List<String> entries = parse(new ILIASFilter(), "test/data/filters/ilias/ILIASFilter.lang");
    assertEquals(7, entries.size());
    int i = 0;
    assertEquals("Good line", entries.get(i++));
    assertEquals("Another good line with HTML <br/> entity", entries.get(i++));
    assertEquals("The text may include : too", entries.get(i++));
    assertEquals("The text may include # as well", entries.get(i++));
    // note the space after "or"
    assertEquals("The text may include  #:# or ", entries.get(i++));
    assertEquals("have it at the end #:#", entries.get(i++));
    assertEquals("#:#", entries.get(i++));
}
Also used : ILIASFilter(org.omegat.filters2.text.ilias.ILIASFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ILIASFilter (org.omegat.filters2.text.ilias.ILIASFilter)2 IAlignCallback (org.omegat.filters2.IAlignCallback)1 IFilter (org.omegat.filters2.IFilter)1