From 7fb58782e670a13ac7389e43ff0bacbce19f9d05 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 14 Feb 2016 11:27:21 +0000 Subject: Wrap subscript runs in --- .../java/org/zwobble/mammoth/tests/DocumentConverterTests.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/test/java/org') diff --git a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java index 8024291..ff12f5d 100644 --- a/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/DocumentConverterTests.java @@ -12,6 +12,7 @@ import java.util.List; import static com.natpryce.makeiteasy.MakeItEasy.*; import static org.hamcrest.MatcherAssert.assertThat; +import static org.zwobble.mammoth.documents.VerticalAlignment.SUBSCRIPT; import static org.zwobble.mammoth.documents.VerticalAlignment.SUPERSCRIPT; import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals; import static org.zwobble.mammoth.tests.documents.DocumentElementMakers.*; @@ -74,6 +75,13 @@ public class DocumentConverterTests { deepEquals(list(Html.element("sup", list(Html.text("Hello")))))); } + @Test + public void subscriptRunsAreWrappedInSubscriptTags() { + assertThat( + convertToHtml(make(a(RUN, with(VERTICAL_ALIGNMENT, SUBSCRIPT), with(CHILDREN, list(new Text("Hello")))))), + deepEquals(list(Html.element("sub", list(Html.text("Hello")))))); + } + private List convertToHtml(DocumentElement element) { return DocumentConverter.convertToHtml(element); -- cgit v1.2.3