Changeset View
Changeset View
Standalone View
Standalone View
autotests/src/scriptdocument_test.cpp
Context not available. | |||||
20 | #include "scriptdocument_test.h" | 20 | #include "scriptdocument_test.h" | ||
---|---|---|---|---|---|
21 | 21 | | |||
22 | #include <kateglobal.h> | 22 | #include <kateglobal.h> | ||
23 | #include "ktexteditor/cursor.h" | ||||
23 | #include <ktexteditor/view.h> | 24 | #include <ktexteditor/view.h> | ||
24 | #include <katedocument.h> | 25 | #include <katedocument.h> | ||
25 | #include <katescriptdocument.h> | 26 | #include <katescriptdocument.h> | ||
26 | 27 | | |||
28 | #include <QJSEngine> | ||||
27 | #include <QtTestWidgets> | 29 | #include <QtTestWidgets> | ||
28 | 30 | | |||
29 | QTEST_MAIN(ScriptDocumentTest) | 31 | QTEST_MAIN(ScriptDocumentTest) | ||
Context not available. | |||||
68 | { | 70 | { | ||
69 | m_doc = new KTextEditor::DocumentPrivate; | 71 | m_doc = new KTextEditor::DocumentPrivate; | ||
70 | m_view = m_doc->createView(nullptr); | 72 | m_view = m_doc->createView(nullptr); | ||
71 | m_scriptDoc = new KateScriptDocument(this); | 73 | m_scriptDoc = new KateScriptDocument(nullptr, this); | ||
72 | m_scriptDoc->setDocument(m_doc); | 74 | m_scriptDoc->setDocument(m_doc); | ||
73 | } | 75 | } | ||
74 | 76 | | |||
Context not available. | |||||
122 | 124 | | |||
123 | m_scriptDoc->setText("a a a a a a a a a a a a"); | 125 | m_scriptDoc->setText("a a a a a a a a a a a a"); | ||
124 | 126 | | |||
125 | QCOMPARE(m_scriptDoc->rfind(searchStart.line(), searchStart.column(), "a a a"), result); | 127 | KTextEditor::Cursor cursor = m_scriptDoc->rfind(searchStart, "a a a"); | ||
128 | QCOMPARE(cursor, result); | ||||
126 | } | 129 | } | ||
127 | 130 | | |||
128 | #include "moc_scriptdocument_test.cpp" | 131 | #include "moc_scriptdocument_test.cpp" | ||
Context not available. |