summaryrefslogtreecommitdiff
path: root/writerperfect/qa/unit/EPUBExportTest.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerperfect/qa/unit/EPUBExportTest.cxx')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index 0d869737fc8e..10fd5eb5a94a 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -63,6 +63,7 @@ public:
void testNamedStyleInheritance();
void testNestedSpan();
void testLineBreak();
+ void testEscape();
CPPUNIT_TEST_SUITE(EPUBExportTest);
CPPUNIT_TEST(testOutlineLevel);
@@ -77,6 +78,7 @@ public:
CPPUNIT_TEST(testNamedStyleInheritance);
CPPUNIT_TEST(testNestedSpan);
CPPUNIT_TEST(testLineBreak);
+ CPPUNIT_TEST(testEscape);
CPPUNIT_TEST_SUITE_END();
};
@@ -330,6 +332,19 @@ void EPUBExportTest::testLineBreak()
assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:br", 1);
}
+void EPUBExportTest::testEscape()
+{
+ createDoc("escape.fodt", {});
+
+ mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+ // This was lost.
+ assertXPathContent(mpXmlDoc, "//xhtml:p[1]/xhtml:span[1]", OUString::fromUtf8("\xc2\xa0"));
+ // Make sure escaping happens only once.
+ assertXPathContent(mpXmlDoc, "//xhtml:p[1]/xhtml:span[2]", "a&b");
+ // This was also lost.
+ assertXPathContent(mpXmlDoc, "//xhtml:p[1]/xhtml:span[3]", "\t");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
}