Search in sources :

Example 1 with StatCount

use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.

the class XLIFFFilterTest method testStatCounting.

@Test
public void testStatCounting() throws Exception {
    String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
    StatisticsSettings.setCountingProtectedText(true);
    StatisticsSettings.setCountingCustomTags(true);
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    StatCount counts = new StatCount(fi.entries.get(0));
    assertEquals(4, counts.words);
}
Also used : StatCount(org.omegat.core.statistics.StatCount) IProject(org.omegat.core.data.IProject) Test(org.junit.Test)

Example 2 with StatCount

use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.

the class XLIFFFilterTest method testStatCountingNoProtectedText.

@Test
public void testStatCountingNoProtectedText() throws Exception {
    String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
    StatisticsSettings.setCountingProtectedText(false);
    StatisticsSettings.setCountingCustomTags(true);
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    StatCount counts = new StatCount(fi.entries.get(0));
    assertEquals(2, counts.words);
}
Also used : StatCount(org.omegat.core.statistics.StatCount) IProject(org.omegat.core.data.IProject) Test(org.junit.Test)

Example 3 with StatCount

use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.

the class XLIFFFilterTest method testStatCountingNoCustomTags.

@Test
public void testStatCountingNoCustomTags() throws Exception {
    String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
    StatisticsSettings.setCountingProtectedText(true);
    StatisticsSettings.setCountingCustomTags(false);
    Preferences.setPreference(Preferences.CHECK_CUSTOM_PATTERN, "CUSTOM");
    PatternConsts.updatePlaceholderPattern();
    IProject.FileInfo fi = loadSourceFiles(filter, f);
    StatCount counts = new StatCount(fi.entries.get(0));
    assertEquals(3, counts.words);
}
Also used : StatCount(org.omegat.core.statistics.StatCount) IProject(org.omegat.core.data.IProject) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 IProject (org.omegat.core.data.IProject)3 StatCount (org.omegat.core.statistics.StatCount)3