Skip to content

Commit 904c110

Browse files
committed
fix: handle arbitrary nesting depth in parseRawTestName
The >= 3 slash-part branch hardcoded indices 0, 1, 2 which dropped parts beyond the third. Swift Testing supports nested suites so names like Module/OuterSuite/InnerSuite/testMethod are possible. Now uses slice/at to preserve the full suite path and final test name.
1 parent 255ecb4 commit 904c110

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/xcodebuild-line-parsers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function parseRawTestName(rawName: string): { suiteName?: string; testNam
6262

6363
const slashParts = rawName.split('/').filter(Boolean);
6464
if (slashParts.length >= 3) {
65-
return { suiteName: `${slashParts[0]}/${slashParts[1]}`, testName: slashParts[2] };
65+
return { suiteName: slashParts.slice(0, -1).join('/'), testName: slashParts.at(-1)! };
6666
}
6767

6868
if (slashParts.length === 2) {

0 commit comments

Comments
 (0)