MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / parseRawTestName

Function parseRawTestName

src/utils/xcodebuild-line-parsers.ts:64–88  ·  view source on GitHub ↗
(rawName: string)

Source from the content-addressed store, hash-verified

62}
63
64export function parseRawTestName(rawName: string): { suiteName?: string; testName: string } {
65 const objcMatch = rawName.match(/^-\[(.+?)\s+(.+)\]$/u);
66 if (objcMatch) {
67 return { suiteName: normalizeSuiteName(objcMatch[1]), testName: objcMatch[2] };
68 }
69
70 const slashParts = rawName.split('/').filter(Boolean);
71 if (slashParts.length >= 3) {
72 return { suiteName: slashParts.slice(0, -1).join('/'), testName: slashParts.at(-1)! };
73 }
74
75 if (slashParts.length === 2) {
76 return {
77 suiteName: normalizeSuiteName(slashParts[0]),
78 testName: slashParts[1],
79 };
80 }
81
82 const dotIndex = rawName.lastIndexOf('.');
83 if (dotIndex > 0 && dotIndex < rawName.length - 1) {
84 return { suiteName: rawName.slice(0, dotIndex), testName: rawName.slice(dotIndex + 1) };
85 }
86
87 return { testName: rawName };
88}
89
90export function parseTestCaseLine(line: string): ParsedTestCase | null {
91 const match = line.match(

Callers 5

walkFunction · 0.90
parseTestCaseLineFunction · 0.85

Calls 1

normalizeSuiteNameFunction · 0.85

Tested by

no test coverage detected