Changeset View
Changeset View
Standalone View
Standalone View
duchain/tests/uses.cpp
Context not available. | |||||
1221 | << RangeInRevision(0, 37, 0, 39)); | 1221 | << RangeInRevision(0, 37, 0, 39)); | ||
---|---|---|---|---|---|
1222 | } | 1222 | } | ||
1223 | 1223 | | |||
1224 | void TestUses::returnTypeClassFunction() { | ||||
1225 | QByteArray method("<? class A { function foo(): A {} function bar(): self {} }"); | ||||
1226 | TopDUContext *top = parse(method, DumpNone); | ||||
1227 | DUChainReleaser releaseTop(top); | ||||
1228 | DUChainWriteLocker lock(DUChain::lock()); | ||||
1229 | | ||||
1230 | Declaration *a = top->localDeclarations().at(0); | ||||
1231 | QCOMPARE(a->identifier().toString(), QString("a")); | ||||
1232 | compareUses(a, QList<RangeInRevision>() << RangeInRevision(0, 29, 0, 30) << RangeInRevision(0, 50, 0, 54)); | ||||
1233 | } | ||||
1234 | | ||||
1235 | void TestUses::returnTypeFunction() { | ||||
1236 | QByteArray method("<? class A {} function foo(): A {}"); | ||||
1237 | TopDUContext *top = parse(method, DumpNone); | ||||
1238 | DUChainReleaser releaseTop(top); | ||||
1239 | DUChainWriteLocker lock(DUChain::lock()); | ||||
1240 | | ||||
1241 | Declaration *a = top->localDeclarations().at(0); | ||||
1242 | QCOMPARE(a->identifier().toString(), QString("a")); | ||||
1243 | compareUses(a, QList<RangeInRevision>() << RangeInRevision(0, 30, 0, 31)); | ||||
1244 | } | ||||
1245 | | ||||
1224 | } | 1246 | } | ||
1225 | 1247 | | |||
Context not available. |