TextEditor: Move test creation closer to tested code

Change-Id: I0f132dddd405bf17161e0e032f9496a90cdc5ab9
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2024-01-19 17:48:18 +01:00
parent df9b802842
commit 610a110341
5 changed files with 70 additions and 54 deletions

View File

@@ -34,6 +34,22 @@ constexpr auto json = R"(
}
)";
class GenerigHighlighterTests final : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void testHighlight_data();
void testHighlight();
void testChange();
void testPreeditText();
void cleanupTestCase();
private:
BaseTextEditor *m_editor = nullptr;
};
void GenerigHighlighterTests::initTestCase()
{
QString title = "test.json";
@@ -221,4 +237,11 @@ void GenerigHighlighterTests::cleanupTestCase()
QVERIFY(Core::EditorManager::currentEditor() == nullptr);
}
QObject *createGenericHighlighterTests()
{
return new GenerigHighlighterTests;
}
} // namespace TextEditor::Internal
#include "highlighter_test.moc"