-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
feb7b51
commit 387e1e8
Showing
2 changed files
with
114 additions
and
3 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
99 changes: 99 additions & 0 deletions
99
...r-owl/src/test/java/org/protege/editor/owl/ui/renderer/RenderingEscapeUtils_TestCase.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,99 @@ | ||
package org.protege.editor.owl.ui.renderer; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
/** | ||
* Matthew Horridge | ||
* Stanford Center for Biomedical Informatics Research | ||
* 21 Feb 2018 | ||
*/ | ||
public class RenderingEscapeUtils_TestCase { | ||
|
||
@Test | ||
public void shouldNotEscapeRendering() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("AB"); | ||
assertThat(rendering, is("AB")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingSpace() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A B"); | ||
assertThat(rendering, is("'A B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingComma() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A,B"); | ||
assertThat(rendering, is("'A,B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingLeftBracket() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A(B"); | ||
assertThat(rendering, is("'A(B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingRightBracket() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A)B"); | ||
assertThat(rendering, is("'A)B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingLeftSquareBracket() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A[B"); | ||
assertThat(rendering, is("'A[B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingRightSquareBracket() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A]B"); | ||
assertThat(rendering, is("'A]B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingLeftBrace() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A{B"); | ||
assertThat(rendering, is("'A{B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingRightBrace() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A}B"); | ||
assertThat(rendering, is("'A}B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingHat() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A^B"); | ||
assertThat(rendering, is("'A^B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingAt() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A@B"); | ||
assertThat(rendering, is("'A@B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingLessThan() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A<B"); | ||
assertThat(rendering, is("'A<B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingGreaterThan() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A>B"); | ||
assertThat(rendering, is("'A>B'")); | ||
} | ||
|
||
@Test | ||
public void shouldEscapeRenderingContainingEquals() { | ||
String rendering = RenderingEscapeUtils.getEscapedRendering("A=B"); | ||
assertThat(rendering, is("'A=B'")); | ||
} | ||
} |