[Gradle, JS] Move classNameOnlyRegExp to class level
This commit is contained in:
@@ -124,7 +124,11 @@ export class StartsWithFilter implements KotlinTestsFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ExactFilter implements KotlinTestsFilter {
|
export class ExactFilter implements KotlinTestsFilter {
|
||||||
|
private readonly classNameOnlyRegExp: RegExp;
|
||||||
|
|
||||||
constructor(public fqn: string) {
|
constructor(public fqn: string) {
|
||||||
|
// Exact filter by class name only
|
||||||
|
this.classNameOnlyRegExp = RegExp(`^${escapeRegExp(this.fqn + ".")}[^\.]+$`);
|
||||||
}
|
}
|
||||||
|
|
||||||
mayContainTestsFromSuite(fqn: string): boolean {
|
mayContainTestsFromSuite(fqn: string): boolean {
|
||||||
@@ -136,9 +140,7 @@ export class ExactFilter implements KotlinTestsFilter {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Exact filter by class name only
|
return this.classNameOnlyRegExp.test(fqn)
|
||||||
const regexp = RegExp(`^${escapeRegExp(this.fqn + ".")}[^\.]+$`);
|
|
||||||
return regexp.test(fqn)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user