DUChain tests and PersistentMovingRange::text

Milian Wolff mail at milianw.de
Sat Jan 14 20:39:36 UTC 2012


Hey there,

I've found an issue when trying to write a unit test for 
https://bugs.kde.org/show_bug.cgi?id=291468

In a unit test, something like this:

QString switchExpression = switchContext->createRangeMoving()->text();

will *always* return an empty QString, see the documentation of 
PersistentMovingRange.

I wonder, how should I best "fix" this? One could easily add a 
CodeRepresentation::rangeText fallback, but that would also require the test-
code to be accessible under some URL, which is not the case for most unit 
tests (since they never write the test-data on-disk).

So, what could be done here?

bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de




More information about the KDevelop-devel mailing list