Allow to create quickfix multifile tests in single file

It simplifies creating new tests
This commit is contained in:
Nikolay Krasko
2015-10-09 18:08:44 +03:00
parent 573738c87e
commit 9ef8370871
9 changed files with 221 additions and 99 deletions
@@ -425,7 +425,7 @@ fun main(args: Array<String>) {
}
testClass<AbstractQuickFixMultiFileTest>() {
model("quickfix", pattern = """^(\w+)\.before\.Main\.\w+$""", testMethod = "doTestWithExtraFile")
model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile")
}
testClass<AbstractHighlightingTest>() {
@@ -109,7 +109,7 @@ public class SimpleTestMethodModel implements TestMethodModel {
Matcher matcher = filenamePattern.matcher(file.getName());
boolean found = matcher.find();
assert found : file.getName() + " isn't matched by regex " + filenamePattern.pattern();
assert matcher.groupCount() == 1 : filenamePattern.pattern();
assert matcher.groupCount() >= 1 : filenamePattern.pattern();
String extractedName = matcher.group(1);
assert extractedName != null : "extractedName should not be null: " + filenamePattern.pattern();