diff --git a/autotests/chattextitemhelpertest.qml b/autotests/chattextitemhelpertest.qml index 8ec9acfda..512f1b61b 100644 --- a/autotests/chattextitemhelpertest.qml +++ b/autotests/chattextitemhelpertest.qml @@ -109,6 +109,34 @@ TestCase { compare(spyCursor.count, 5); } + function test_longFixedChars(): void { + textEdit.forceActiveFocus(); + testHelper.setFixedChars("111", "222"); + compare(textEdit.text, "111222"); + compare(textEdit.cursorPosition, 3); + compare(spyCursor.count, 0); + keyClick("b"); + compare(textEdit.text, "111b222"); + compare(textEdit.cursorPosition, 4); + compare(spyCursor.count, 1); + keyClick(Qt.Key_Left); + compare(textEdit.text, "111b222"); + compare(textEdit.cursorPosition, 3); + compare(spyCursor.count, 2); + keyClick(Qt.Key_Left); + compare(textEdit.text, "111b222"); + compare(textEdit.cursorPosition, 3); + compare(spyCursor.count, 3); + keyClick(Qt.Key_Right); + compare(textEdit.text, "111b222"); + compare(textEdit.cursorPosition, 4); + compare(spyCursor.count, 4); + keyClick(Qt.Key_Right); + compare(textEdit.text, "111b222"); + compare(textEdit.cursorPosition, 4); + compare(spyCursor.count, 5); + } + function test_document(): void { // We can't get to the QTextDocument from QML so we have to use a helper function. compare(testHelper.compareDocuments(textEdit.textDocument), true); diff --git a/autotests/texthandlertest.cpp b/autotests/texthandlertest.cpp index 6a472f0ed..e798d4e47 100644 --- a/autotests/texthandlertest.cpp +++ b/autotests/texthandlertest.cpp @@ -626,10 +626,10 @@ void TextHandlerTest::componentOutput_data() MessageComponent{MessageComponentType::Code, u"Some code"_s, QVariantMap{{u"class"_s, u"html"_s}}}}; QTest::newRow("quote") << u"
Text
\n\n"_s << QListblockquote
\n
\n"_s << QListblockquote
\nnext paragraph
\n
“blockquote
\nnext paragraph”
"_s, {}}}; + MessageComponent{MessageComponentType::Quote, u"\"blockquote
\nnext paragraph\"
"_s, {}}}; QTest::newRow("no tag first paragraph") << u"Text\nText
"_s << QList