Changeset View
Changeset View
Standalone View
Standalone View
plugins/clang/tests/test_codecompletion.cpp
Show First 20 Lines • Show All 835 Lines • ▼ Show 20 Line(s) | 835 | << R"( | |||
---|---|---|---|---|---|
836 | class Klass { | 836 | class Klass { | ||
837 | public: | 837 | public: | ||
838 | template <typename T> | 838 | template <typename T> | ||
839 | void func(int a, T x, int b) const; | 839 | void func(int a, T x, int b) const; | ||
840 | }; | 840 | }; | ||
841 | )" | 841 | )" | ||
842 | << CompletionItems{{6, 0}, {"Klass::func(int a, T x, int b) const"}}; | 842 | << CompletionItems{{6, 0}, {"Klass::func(int a, T x, int b) const"}}; | ||
843 | 843 | | |||
844 | QTest::newRow("bug373722-using-directive") | ||||
845 | << R"( | ||||
846 | namespace A { | ||||
847 | namespace B { | ||||
848 | namespace C { | ||||
849 | void foo(); | ||||
850 | } | ||||
851 | } | ||||
852 | } | ||||
853 | using namespace A::B; | ||||
854 | )" | ||||
855 | << CompletionItems{{9, 0}, {"C::foo()"}}; | ||||
844 | } | 856 | } | ||
845 | 857 | | |||
846 | void TestCodeCompletion::testImplementOtherFile() | 858 | void TestCodeCompletion::testImplementOtherFile() | ||
847 | { | 859 | { | ||
848 | TestFile header1(QStringLiteral("void foo();"), QStringLiteral("h")); | 860 | TestFile header1(QStringLiteral("void foo();"), QStringLiteral("h")); | ||
849 | QVERIFY(header1.parseAndWait()); | 861 | QVERIFY(header1.parseAndWait()); | ||
850 | TestFile header2(QStringLiteral("void bar();"), QStringLiteral("h")); | 862 | TestFile header2(QStringLiteral("void bar();"), QStringLiteral("h")); | ||
851 | QVERIFY(header2.parseAndWait()); | 863 | QVERIFY(header2.parseAndWait()); | ||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |