[Libreoffice-commits] core.git: writerperfect/qa

Miklos Vajna vmiklos at collabora.co.uk
Tue Sep 26 17:03:34 UTC 2017


 writerperfect/qa/unit/EPUBExportTest.cxx               |   11 +++++++++++
 writerperfect/qa/unit/data/writer/epubexport/link.fodt |    8 ++++++++
 2 files changed, 19 insertions(+)

New commits:
commit d81e6184f691cf49abdbf3b3714c507dcca3a50c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Sep 26 11:07:13 2017 +0200

    EPUB export: test link handling
    
    Fails without commit 9480ff6a2b6057410940ff5c40828d5746898a0e (EPUB
    export: implement link support, 2017-08-17).
    
    Change-Id: Icee6ac04ff77d0e9ff66ca1f925d6973b4b342a2
    Reviewed-on: https://gerrit.libreoffice.org/42786
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5b3f4b9a0c27..d79a196c7863 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -71,6 +71,7 @@ public:
     void testList();
     void testImage();
     void testTable();
+    void testLink();
 
     CPPUNIT_TEST_SUITE(EPUBExportTest);
     CPPUNIT_TEST(testOutlineLevel);
@@ -91,6 +92,7 @@ public:
     CPPUNIT_TEST(testList);
     CPPUNIT_TEST(testImage);
     CPPUNIT_TEST(testTable);
+    CPPUNIT_TEST(testLink);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -453,6 +455,15 @@ void EPUBExportTest::testTable()
     assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr/xhtml:td", 4);
 }
 
+void EPUBExportTest::testLink()
+{
+    createDoc("link.fodt", {});
+
+    mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+    assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a", "https://libreoffice.org/");
+    assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", "https://libreoffice.org/");
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
 
 }
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link.fodt b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
new file mode 100644
index 000000000000..9a2efcc0b7a8
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+  <office:body>
+    <office:text>
+      <text:p>Before <text:a xlink:type="simple" xlink:href="https://libreoffice.org/">https://libreoffice.org/</text:a> after.</text:p>
+    </office:text>
+  </office:body>
+</office:document>


More information about the Libreoffice-commits mailing list