Skip to content

Commit

Permalink
exclude $WhenMappings inner class in JUnit Platform
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyguava committed May 11, 2024
1 parent 2859667 commit a29b234
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* a detection or filename scan is performed to find test classes.
*/
public class DefaultTestClassScanner implements Runnable {
private static final Pattern ANONYMOUS_CLASS_NAME = Pattern.compile(".*\\$\\d+");
private static final Pattern ANONYMOUS_CLASS_NAME = Pattern.compile(".*\\$\\d+(?:\\$WhenMappings)?");
private final FileTree candidateClassFiles;
private final TestFrameworkDetector testFrameworkDetector;
private final TestClassProcessor testClassProcessor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class DefaultTestClassScannerTest extends Specification {
assert visitor
visitor.visitFile(stubFileVisitDetails('AnonymousClass$1'))
visitor.visitFile(stubFileVisitDetails('AnonymousClass$1$22'))
visitor.visitFile(stubFileVisitDetails('AnonymousClass$1$22$WhenMappings'))
}

0 * _._
Expand Down

0 comments on commit a29b234

Please sign in to comment.