File indexing completed on 2024-04-28 03:57:08

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2014 Miquel Sabaté Solà <mikisabate@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef COMPLETION_TEST_H
0009 #define COMPLETION_TEST_H
0010 
0011 #include "base.h"
0012 #include "fakecodecompletiontestmodel.h"
0013 
0014 /**
0015  * This class handles implements a completion model for the completion
0016  * tests defined in the CompletionTest class.
0017  */
0018 class VimCodeCompletionTestModel : public KTextEditor::CodeCompletionModel
0019 {
0020 public:
0021     explicit VimCodeCompletionTestModel(KTextEditor::View *parent);
0022     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0023 };
0024 
0025 /**
0026  * This class implements a completion model used in the CompletionTest class
0027  * to test that code completion is not invoked.
0028  */
0029 class FailTestOnInvocationModel : public KTextEditor::CodeCompletionModel
0030 {
0031 public:
0032     explicit FailTestOnInvocationModel(KTextEditor::View *parent);
0033     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0034     void failTest() const;
0035 };
0036 
0037 class CompletionTest : public BaseTest
0038 {
0039     Q_OBJECT
0040 
0041 private Q_SLOTS:
0042     void FakeCodeCompletionTests();
0043     void CompletionTests();
0044 
0045 private:
0046     void waitForCompletionWidgetToActivate();
0047     void clearTrackedDocumentChanges();
0048 };
0049 
0050 #endif /* COMPLETION_TEST_H */