Search in sources :

Example 1 with UnitsToLatexFormatter

use of org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter in project jabref by JabRef.

the class CleanupWorkerTest method cleanupUnitsConvertsOneAmpereToLatex.

@Test
public void cleanupUnitsConvertsOneAmpereToLatex() {
    CleanupPreset preset = new CleanupPreset(new FieldFormatterCleanups(true, Collections.singletonList(new FieldFormatterCleanup("title", new UnitsToLatexFormatter()))));
    BibEntry entry = new BibEntry();
    entry.setField("title", "1 A");
    worker.cleanup(preset, entry);
    Assert.assertEquals(Optional.of("1~{A}"), entry.getField("title"));
}
Also used : BibEntry(org.jabref.model.entry.BibEntry) FieldFormatterCleanups(org.jabref.model.cleanup.FieldFormatterCleanups) FieldFormatterCleanup(org.jabref.model.cleanup.FieldFormatterCleanup) UnitsToLatexFormatter(org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter) Test(org.junit.Test)

Aggregations

UnitsToLatexFormatter (org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter)1 FieldFormatterCleanup (org.jabref.model.cleanup.FieldFormatterCleanup)1 FieldFormatterCleanups (org.jabref.model.cleanup.FieldFormatterCleanups)1 BibEntry (org.jabref.model.entry.BibEntry)1 Test (org.junit.Test)1