summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-03-20 16:20:54 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2023-03-20 20:16:51 +0000
commit92b732ce29f734d91fb6c9350b9a8b6df7f9293e (patch)
tree8614a92fcc7321152109bb4d99fb2f82c4ee8ddf /sw/qa
parent468fbbc0f5676ec5a630041f835940f673888d83 (diff)
tdf#154273: sw_htmlimport: Add unittest
Change-Id: I9d65f514979bbd24380210dc9006b6ed2649b37a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149165 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/htmlimport/data/tdf154273.html9
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx10
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlimport/data/tdf154273.html b/sw/qa/extras/htmlimport/data/tdf154273.html
new file mode 100644
index 000000000000..6a8b8dc6380b
--- /dev/null
+++ b/sw/qa/extras/htmlimport/data/tdf154273.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ </head>
+ <body>
+ &apos;test&apos;
+ </body>
+</html>
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index fe062f5c83fd..41efcee327f3 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -520,6 +520,16 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testUTF16_nonBMP)
getParagraph(1)->getString());
}
+CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf154273)
+{
+ createSwWebDoc("tdf154273.html");
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 'test'
+ // - Actual : &apos;test&apos;
+ CPPUNIT_ASSERT_EQUAL(OUString("'test' "), getParagraph(1)->getString());
+}
+
CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData)
{
// Given an XHTML with an <object> (containing non-image, non-OLE2 data) and an inner <object>