-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Style RemoveLatexCommandsFormatter - Add tests for RemoveLatexCommandsFormatter - Add support for removing single and multiple whitespaces after a command - Split tests in RemoveBracketsTest - Fix casing in CleanupUrlFormatter (to match style and current name of test class CleanUpFormatterTest) - Fix casing in some ...Url.. method names - Format CleanupUrlFormatter
- Loading branch information
Showing
10 changed files
with
141 additions
and
49 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
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
63 changes: 63 additions & 0 deletions
63
src/test/java/org/jabref/logic/layout/format/RemoveLatexCommandsFormatterTest.java
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.jabref.logic.layout.format; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class RemoveLatexCommandsFormatterTest { | ||
|
||
private RemoveLatexCommandsFormatter formatter; | ||
|
||
@BeforeEach | ||
public void setUp() { | ||
formatter = new RemoveLatexCommandsFormatter(); | ||
} | ||
|
||
@Test | ||
public void withoutLatexCommandsUnmodified() { | ||
assertEquals("some text", formatter.format("some text")); | ||
} | ||
|
||
@Test | ||
public void singleCommandWiped() { | ||
assertEquals("", formatter.format("\\sometext")); | ||
} | ||
|
||
@Test | ||
public void singleSpaceAfterCommandRemoved() { | ||
assertEquals("text", formatter.format("\\some text")); | ||
} | ||
|
||
@Test | ||
public void multipleSpacesAfterCommandRemoved() { | ||
assertEquals("text", formatter.format("\\some text")); | ||
} | ||
|
||
@Test | ||
public void escapedBackslashBecomesBackslash() { | ||
assertEquals("\\", formatter.format("\\\\")); | ||
} | ||
|
||
@Test | ||
public void escapedBackslashFollowedByTextBecomesBackslashFollowedByText() { | ||
assertEquals("\\some text", formatter.format("\\\\some text")); | ||
} | ||
|
||
@Test | ||
public void escapedBackslashKept() { | ||
assertEquals("\\some text\\", formatter.format("\\\\some text\\\\")); | ||
} | ||
|
||
@Test | ||
public void escapedUnderscoreReplaces() { | ||
assertEquals("some_text", formatter.format("some\\_text")); | ||
} | ||
|
||
@Test | ||
public void exampleUrlCorrectlyCleaned() { | ||
assertEquals("http://pi.informatik.uni-siegen.de/stt/36_2/./03_Technische_Beitraege/ZEUS2016/beitrag_2.pdf", formatter.format("http://pi.informatik.uni-siegen.de/stt/36\\_2/./03\\_Technische\\_Beitraege/ZEUS2016/beitrag\\_2.pdf")); | ||
} | ||
|
||
|
||
} |