-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import java.util.Collections; | ||
|
||
import org.jabref.logic.layout.format.FileLinkPreferences; | ||
import org.jabref.logic.layout.format.NameFormatterPreferences; | ||
import org.jabref.model.entry.BibEntry; | ||
import org.jabref.model.entry.BibtexEntryTypes; | ||
import org.jabref.model.entry.CustomEntryType; | ||
|
@@ -98,8 +99,10 @@ void HTMLCharsWithDotlessIAndTiled() throws IOException { | |
layoutText); | ||
} | ||
|
||
/** | ||
* Test for http://discourse.jabref.org/t/the-wrapfilelinks-formatter/172 (the example in the help files) | ||
*/ | ||
@Test | ||
// Test for http://discourse.jabref.org/t/the-wrapfilelinks-formatter/172 (the example in the help files) | ||
void wrapFileLinksExpandFile() throws IOException { | ||
when(layoutFormatterPreferences.getFileLinkPreferences()).thenReturn( | ||
new FileLinkPreferences(Collections.emptyList(), Collections.singletonList("src/test/resources/pdfs/"))); | ||
|
@@ -121,4 +124,15 @@ void expandCommandIfTerminatedByMinus() throws IOException { | |
|
||
assertEquals("2-th ed.-", layoutText); | ||
} | ||
|
||
@Test | ||
void customNameFormatter() throws IOException { | ||
when(layoutFormatterPreferences.getNameFormatterPreferences()).thenReturn( | ||
new NameFormatterPreferences(Collections.singletonList("DCA"), Collections.singletonList("1@*@{ll}@@[email protected]@{ff}{ll}@2..2@ and {ff}{l}@@*@*@more"))); | ||
BibEntry entry = new BibEntry(BibtexEntryTypes.ARTICLE).withField("author", "Joe Doe and Mary Jane"); | ||
|
||
String layoutText = layout("\\begin{author}\\format[DCA]{\\author}\\end{author}", entry); | ||
|
||
assertEquals("JoeDoe and MaryJ", layoutText); | ||
} | ||
} |