aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-02-20 15:13:43 +0000
committerMichael Williamson <mike@zwobble.org>2016-02-20 15:13:43 +0000
commit886f4c1b68fa85eb0dbdd0088ea62a2c864febbe (patch)
tree41db5b424dc845c0380bed0c487758fb82bd3066 /src/test/java/org/zwobble/mammoth/tests
parent70f03f3de834bd1ce3e12e71e9809b845a41f8a4 (diff)
Make style names on matchers case insensitive
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/styles/ParagraphMatcherTests.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/styles/ParagraphMatcherTests.java b/src/test/java/org/zwobble/mammoth/tests/styles/ParagraphMatcherTests.java
index 8c75369..fdaa075 100644
--- a/src/test/java/org/zwobble/mammoth/tests/styles/ParagraphMatcherTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/styles/ParagraphMatcherTests.java
@@ -60,4 +60,14 @@ public class ParagraphMatcherTests {
with(STYLE, Optional.of(new Style("Heading 1", Optional.of("Heading 1"))))));
assertFalse(matcher.matches(paragraphWithIncorrectStyleName));
}
+
+ @Test
+ public void styleNamesAreCaseInsensitive() {
+ ParagraphMatcher matcher = ParagraphMatcher.styleName("tips paragraph");
+ assertFalse(matcher.matches(make(a(PARAGRAPH))));
+
+ Paragraph paragraphWithCorrectStyleName = make(a(PARAGRAPH,
+ with(STYLE, Optional.of(new Style("TipsParagraph", Optional.of("Tips Paragraph"))))));
+ assertTrue(matcher.matches(paragraphWithCorrectStyleName));
+ }
}