Skip to content

Commit ac3676c

Browse files
authored
check if nested test starts with the parent's name before cleaning it (#71)
1 parent 29593ec commit ac3676c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/apache/maven/plugin/surefire/report/ActualTreePrinter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ private void printClass(Node node) {
144144
}
145145

146146
private String cleanReportName(Node node) {
147-
if (node.getParent().getClassReportEntry() != null) {
147+
if (node.getParent().getClassReportEntry() != null &&
148+
node.getClassReportEntry().getReportNameWithGroup().startsWith(node.getParent().getClassReportEntry().getReportNameWithGroup())
149+
) {
148150
int stringSizeToRemove = node.getParent().getClassReportEntry().getReportNameWithGroup().length() + 1;
149151
return node.getClassReportEntry().getReportNameWithGroup().substring(stringSizeToRemove);
150152
} else {

0 commit comments

Comments
 (0)