Commit a1ca3102 authored by Laurent Montel's avatar Laurent Montel 😁

Rename function. Test change format

parent 0105aa86
......@@ -230,7 +230,7 @@ void AutoCorrectionTest::shouldNotReplaceUppercaseLetter()
QCOMPARE(doc.toPlainText(), text);
}
void AutoCorrectionTest::shouldReplaceToBold()
void AutoCorrectionTest::shouldReplaceToTextFormat()
{
PimCommon::AutoCorrection autocorrection;
autocorrection.setEnabledAutoCorrection(true);
......@@ -255,12 +255,24 @@ void AutoCorrectionTest::shouldReplaceToBold()
position = text.length();
autocorrection.autocorrect(true, doc, position);
QCOMPARE(doc.toPlainText(), result);
QTextCursor cursor(&doc);
cursor.setPosition(2);
QTextCharFormat charFormat = cursor.charFormat();
QCOMPARE(charFormat.font().underline(), true);
QCOMPARE(charFormat.font().bold(), false);
QCOMPARE(charFormat.font().strikeOut(), false);
text = QLatin1String("-foo-");
doc.setHtml(text);
position = text.length();
autocorrection.autocorrect(true, doc, position);
QCOMPARE(doc.toPlainText(), result);
cursor = QTextCursor(&doc);
cursor.setPosition(2);
charFormat = cursor.charFormat();
QCOMPARE(charFormat.font().underline(), false);
QCOMPARE(charFormat.font().bold(), false);
QCOMPARE(charFormat.font().strikeOut(), true);
//Don't convert it.
text = QLatin1String("-foo1");
......
......@@ -35,7 +35,7 @@ private Q_SLOTS:
void shouldReplaceSingleQuote();
void shouldReplaceDoubleQuote();
void shouldNotReplaceUppercaseLetter();
void shouldReplaceToBold();
void shouldReplaceToTextFormat();
void shouldReplaceAutoFraction();
void shouldNotAddSpaceWhenWeAlreadyHaveASpace();
void shouldAutocorrectWord();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment