| 247 | } |
| 248 | |
| 249 | void TestStringHelpers::testParamIterator() |
| 250 | { |
| 251 | QFETCH(QString, parens); |
| 252 | QFETCH(QString, source); |
| 253 | QFETCH(QStringList, params); |
| 254 | QFETCH(int, endPosition); |
| 255 | |
| 256 | auto it = KDevelop::ParamIterator(parens, source); |
| 257 | |
| 258 | QEXPECT_FAIL("hardToParse<A<B>", "quasi impossible to parse without semantic knowledge of the types", Abort); |
| 259 | |
| 260 | int i = 0; |
| 261 | while (!params.isEmpty()) { |
| 262 | QVERIFY(it); |
| 263 | if (i == 1) { |
| 264 | QEXPECT_FAIL("Y<decltype(&X::operator<=), &X::operator<=>", "clang triggers warning for this C++17 code, due to C++20 spaceship op", Continue); |
| 265 | QEXPECT_FAIL("Y<decltype(&X::operator<=), Z<&X::operator<=>>", |
| 266 | "clang triggers warning for this C++17 code, due to C++20 spaceship op", Continue); |
| 267 | } |
| 268 | QCOMPARE(*it, params.takeFirst()); |
| 269 | ++it; |
| 270 | ++i; |
| 271 | } |
| 272 | |
| 273 | QVERIFY(!it); |
| 274 | QCOMPARE(it.position(), endPosition); |
| 275 | } |
| 276 | |
| 277 | #include "moc_test_stringhelpers.cpp" |