| 166 | } |
| 167 | |
| 168 | auto AddTestCasesWizard::getMatchedPart(const QString &str, const QString &pattern) -> QStringList { |
| 169 | QStringList result; |
| 170 | |
| 171 | for (int i = 0; i < ui->argumentList->rowCount(); i++) |
| 172 | result.append(""); |
| 173 | |
| 174 | for (int pos = 0, i = 0; pos < pattern.length(); i++, pos++) { |
| 175 | if (pos + 2 < pattern.length()) { |
| 176 | if (pattern[pos] == '<' && pattern[pos + 1].isDigit() && pattern[pos + 1] != '0' && |
| 177 | pattern[pos + 2] == '>') { |
| 178 | int index = pattern[pos + 1].toLatin1() - 49; |
| 179 | QString regExp = ui->argumentList->item(index, 1)->text(); |
| 180 | |
| 181 | for (int j = i; j < str.length(); j++) { |
| 182 | regExp = QRegularExpression::anchoredPattern(regExp); |
| 183 | if (QRegularExpression(regExp).match(str.mid(i, j - i + 1)).hasMatch()) { |
| 184 | if (QRegularExpression( |
| 185 | QRegularExpression::anchoredPattern(getFullRegExp(pattern.mid(pos + 3)))) |
| 186 | .match(str.mid(j + 1)) |
| 187 | .hasMatch()) { |
| 188 | result[index] = str.mid(i, j - i + 1); |
| 189 | i = j; |
| 190 | break; |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | pos += 2; |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | return result; |
| 200 | } |
| 201 | |
| 202 | void AddTestCasesWizard::searchMatchedFiles() { |
| 203 | QStringList inputFiles; |
nothing calls this directly
no outgoing calls
no test coverage detected