(raw: string)
| 127 | } |
| 128 | |
| 129 | export function parseXcresultFailureMessage(raw: string): { message: string; location?: string } { |
| 130 | const [firstLine = '', ...continuationLines] = raw.split(/\r?\n/u); |
| 131 | const match = firstLine.match(/^(.+?):(\d+):\s*(.*)$/u); |
| 132 | if (match) { |
| 133 | const message = [match[3], ...continuationLines] |
| 134 | .join('\n') |
| 135 | .replace(/^failed\s*-\s*/u, '') |
| 136 | .replace(/:\s+(?=\/\/)/u, '\n'); |
| 137 | return { |
| 138 | location: match[2] === '0' ? undefined : `${match[1]}:${match[2]}`, |
| 139 | message, |
| 140 | }; |
| 141 | } |
| 142 | return { message: raw }; |
| 143 | } |
no outgoing calls
no test coverage detected