summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-28 09:28:53 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-28 09:28:53 (GMT)
commita93e423bf8f54d21f51b1082612688d4e155b5e9 (patch)
treebe04d17a48c0efe18a40630e88b9a85f5adf7956
parentf1ae45fd034765df019081a9d54dfaed35155a26 (diff)
improve autotest
-rw-r--r--messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
index 4795691..a513879 100644
--- a/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
+++ b/messagecomposer/src/composer-ng/autotests/richtextcomposerngtest.cpp
@@ -78,6 +78,8 @@ void RichTextComposerNgTest::shouldForceAutoCorrectionWithSelection_data()
QTest::addColumn<int>("selectionStart");
QTest::addColumn<int>("selectionEnd");
QTest::newRow("noselection") << QStringLiteral("\nboo bla bli.\nfoo faa") << QStringLiteral("\nBoo bla bli.\nFoo faa") << 0 << 0;
+ QTest::newRow("noselection2") << QStringLiteral("\nboo bla bli.\nfoo faa") << QStringLiteral("\nBoo bla bli.\nFoo faa") << 1 << 1;
+ QTest::newRow("fullselection") << QStringLiteral("\nboo bla bli.\nfoo faa") << QStringLiteral("\nBoo bla bli.\nFoo faa") << 0 << 22;
}
void RichTextComposerNgTest::shouldForceAutoCorrectionWithSelection()
@@ -90,6 +92,10 @@ void RichTextComposerNgTest::shouldForceAutoCorrectionWithSelection()
MessageComposer::RichTextComposerNg richtextComposerNg;
richtextComposerNg.setPlainText(original);
+ QTextCursor cur = richtextComposerNg.textCursor();
+ cur.setPosition(selectionStart);
+ cur.setPosition(selectionEnd, QTextCursor::KeepAnchor);
+ richtextComposerNg.setTextCursor(cur);
PimCommon::AutoCorrection autocorrection;
autocorrection.setEnabledAutoCorrection(true);
autocorrection.setUppercaseFirstCharOfSentence(true);