Unit test for "implement function" completion
David Nolden
zwabel at googlemail.com
Tue Mar 22 09:13:24 UTC 2011
I think these helpers are not generated in test-mode, because they have
compile-dependencies which are not part of the test_cppcodecompletion, and
would require some refactoring to be integrated.
We should change this though, as we require tests for this too. We need a
test-architecture which includes ktexteditor documents to make this perfect,
because right now, we have generally no way to test the execution of items.
Greetings, David
Am 21.03.2011 23:59 schrieb "Dmitry Risenberg" <dmitry.risenberg at gmail.com>:
> I want to write a unit test for this:
> https://bugs.kde.org/show_bug.cgi?id=255038.
> I tried the following code, following other unit tests in
test_cppcodecompletion
>
> QByteArray test = "class A {}; class B : public A { B(int i); };";
> TopDUContext* context = parse( test, DumpNone /*DumpDUChain | DumpAST */);
> DUChainWriteLocker lock(DUChain::lock());
> CompletionItemTester tester(context, "");
>
> "" - stands for pressing a Ctrl+Space.
>
> However, tester.items contains only two items - "A" and "B" - and no
> item "implement constructor", while completion in a file with the same
> contents has an entry for implementing constructor. What am I doing
> wrong?
>
> --
> Dmitry Risenberg
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110322/abcfd71b/attachment-0001.html>
More information about the KDevelop-devel
mailing list