From 92b732ce29f734d91fb6c9350b9a8b6df7f9293e Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 20 Mar 2023 16:20:54 +0100 Subject: 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 --- sw/qa/extras/htmlimport/data/tdf154273.html | 9 +++++++++ sw/qa/extras/htmlimport/htmlimport.cxx | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sw/qa/extras/htmlimport/data/tdf154273.html (limited to 'sw/qa') 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 @@ + + + + + + + 'test' + + 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 : 'test' + CPPUNIT_ASSERT_EQUAL(OUString("'test' "), getParagraph(1)->getString()); +} + CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData) { // Given an XHTML with an (containing non-image, non-OLE2 data) and an inner -- cgit