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

Test convert to bold

parent 09c5ec7b
......@@ -250,7 +250,8 @@ void AutoCorrectionTest::shouldReplaceToTextFormat()
autocorrection.autocorrect(true, doc, position);
QCOMPARE(doc.toPlainText(), result);
text = QLatin1String("_foo_");
text = QLatin1String("*foo*");
doc.setHtml(text);
position = text.length();
autocorrection.autocorrect(true, doc, position);
......@@ -258,6 +259,20 @@ void AutoCorrectionTest::shouldReplaceToTextFormat()
QTextCursor cursor(&doc);
cursor.setPosition(2);
QTextCharFormat charFormat = cursor.charFormat();
QCOMPARE(charFormat.font().underline(), false);
QCOMPARE(charFormat.font().bold(), true);
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(), true);
QCOMPARE(charFormat.font().bold(), false);
QCOMPARE(charFormat.font().strikeOut(), false);
......
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