From a26c373708753088722b1ec83af20077f38ea352 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 12 Dec 2023 15:19:11 +0100 Subject: [PATCH] FakeVim: Fix tests Amends: e396f84d10aef973e752e7519f85de80d7dcdb86 Change-Id: I3c871006326dc691d24cc715c5a05f5c5acdadc7 Reviewed-by: David Schulz --- src/plugins/fakevim/fakevim_test.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevim_test.cpp b/src/plugins/fakevim/fakevim_test.cpp index 6d1dd74b3ca..c81a40a2280 100644 --- a/src/plugins/fakevim/fakevim_test.cpp +++ b/src/plugins/fakevim/fakevim_test.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include @@ -346,7 +348,10 @@ struct FakeVimTester::TestData void doCommand(const QString &cmd) { handler->handleCommand(cmd); } void doCommand(const char *cmd) { doCommand(_(cmd)); } - void doKeys(const QString &keys) { handler->handleInput(keys); } + void doKeys(const QString &keys) { + handler->handleInput(keys); + QTRY_VERIFY(editor()->textDocument()->syntaxHighlighterRunner()->syntaxInfoUpdated()); + } void doKeys(const char *keys) { doKeys(_(keys)); } void setText(const char *text) @@ -359,6 +364,7 @@ struct FakeVimTester::TestData else i = 0; editor()->document()->setPlainText(_(str)); + QTRY_VERIFY(editor()->textDocument()->syntaxHighlighterRunner()->syntaxInfoUpdated()); setPosition(i); QCOMPARE(position(), i); } @@ -369,6 +375,7 @@ struct FakeVimTester::TestData QTextCursor tc = editor()->textCursor(); tc.insertText(_(text)); editor()->setTextCursor(tc); + QTRY_VERIFY(editor()->textDocument()->syntaxHighlighterRunner()->syntaxInfoUpdated()); } // Simulate external position change. @@ -2988,6 +2995,7 @@ void FakeVimTester::test_vim_code_folding() // delete folded lined if deleting to the end of the first folding line data.doKeys("zMgg"); + //QTRY_COMPARE(data.lines(), lines - 8); QCOMPARE(data.lines(), lines - 8); KEYS("wwd$", "int main" N ""); @@ -5052,3 +5060,4 @@ void FakeVimTester::test_vim_qtcreator() } // FakeVim::Internal #include "fakevim_test.moc" +