Skip to content

Commit 5b575c2

Browse files
committed
try nested table
1 parent a413836 commit 5b575c2

1 file changed

Lines changed: 34 additions & 21 deletions

File tree

src/testResultsSummary.ts

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,32 +138,45 @@ function generateFailedTestRow(test: MatlabTestCase): string {
138138
<td>
139139
<details>
140140
<summary>View details</summary>
141-
<pre style="font-family: monospace; white-space: pre; overflow-x: auto;">` +
142-
test.diagnostics.map(d => formatDiagnosticReport(d.report)).join('\n') +
143-
`</pre>
141+
<table>
142+
<tr>
143+
<th>Actual</th>
144+
<th>Expected</th>
145+
<th>Error</th>
146+
<th>RelativeError</th>
147+
</tr>
148+
<tr>
149+
<td>2.5</td>
150+
<td>3.0</td>
151+
<td>-0.5</td>
152+
<td>-0.167</td>
153+
</tr>
154+
</table>
155+
<pre style="font-family: monospace; white-space: pre;">${test.diagnostics.map(d => d.report).join('\n')}</pre>
144156
</details>
145157
</td>
146158
</tr>`;
147159
}
148160

149-
function formatDiagnosticReport(report: string): string {
150-
return report
151-
// HTML special characters
152-
.replace(/&/g, '&amp;')
153-
.replace(/</g, '&lt;')
154-
.replace(/>/g, '&gt;')
155-
.replace(/"/g, '&quot;')
156-
.replace(/'/g, '&#039;')
157-
.replace(/`/g, '&#096;')
158-
// Path separators for all OS
159-
.replace(/\\/g, '\\\\') // Windows backslash
160-
.replace(/\//g, '/') // Unix forward slash
161-
// Preserve MATLAB formatting
162-
.replace(/\r\n/g, '\n') // Windows line endings
163-
.replace(/\r/g, '\n') // Mac old-style line endings
164-
.replace(/\t/g, ' ') // Tabs to spaces
165-
.trim();
166-
}
161+
162+
// function formatDiagnosticReport(report: string): string {
163+
// return report
164+
// // HTML special characters
165+
// .replace(/&/g, '&amp;')
166+
// .replace(/</g, '&lt;')
167+
// .replace(/>/g, '&gt;')
168+
// .replace(/"/g, '&quot;')
169+
// .replace(/'/g, '&#039;')
170+
// .replace(/`/g, '&#096;')
171+
// // Path separators for all OS
172+
// .replace(/\\/g, '\\\\') // Windows backslash
173+
// .replace(/\//g, '/') // Unix forward slash
174+
// // Preserve MATLAB formatting
175+
// .replace(/\r\n/g, '\n') // Windows line endings
176+
// .replace(/\r/g, '\n') // Mac old-style line endings
177+
// .replace(/\t/g, ' ') // Tabs to spaces
178+
// .trim();
179+
// }
167180

168181
function getStatusEmoji(status: MatlabTestStatus): string {
169182
switch (status) {

0 commit comments

Comments
 (0)