diff options
author | Henry Castro <hcastro@collabora.com> | 2023-02-08 13:36:44 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-02-15 12:16:06 +0000 |
commit | 235c892393f8c1459aa68447a0e3621e2b3cd10c (patch) | |
tree | e37ff9d6dbb2a9beec74d9904536215e7b9fd013 /editeng | |
parent | 3c871dbdff374eb28f8fb5507f630a102450507f (diff) |
editeng:qa: add single line unit test
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I8abd816ec7c115d5a1f17d3b68e3e758cea02d82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index cefeca9453ba..3e7087ffcd87 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -97,6 +97,8 @@ public: void testTransliterate(); + void testSingleLine(); + DECL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, void ); CPPUNIT_TEST_SUITE(Test); @@ -119,6 +121,7 @@ public: CPPUNIT_TEST(testSectionAttributes); CPPUNIT_TEST(testLargeParaCopyPaste); CPPUNIT_TEST(testTransliterate); + CPPUNIT_TEST(testSingleLine); CPPUNIT_TEST_SUITE_END(); private: @@ -1756,6 +1759,19 @@ void Test::testTransliterate() CPPUNIT_ASSERT_EQUAL(OUString("One (Two) Three"), aEditEngine.GetText()); } +void Test::testSingleLine() +{ + EditEngine aEditEngine( mpItemPool.get() ); + + OUString sText("Bolivian\nSanta Cruz de la Sierra"); + aEditEngine.SetControlWord(aEditEngine.GetControlWord() | EEControlBits::SINGLELINE); + aEditEngine.SetText(sText); + aEditEngine.QuickFormatDoc(true); + CPPUNIT_ASSERT_EQUAL(true, aEditEngine.IsFormatted()); + CPPUNIT_ASSERT_EQUAL(1, aEditEngine.GetParagraphCount()); + CPPUNIT_ASSERT_EQUAL(1, aEditEngine.GetLineCount(0)); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |