Skip to content

Commit f24d519

Browse files
committed
introduce test failure
1 parent 0738bc4 commit f24d519

2 files changed

Lines changed: 12 additions & 25 deletions

File tree

sample/visualization/tests/TestExamples.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function testNonLeapYear(testCase)
3232

3333
% Verify that the two are equal
3434
testCase.verifyEqual(doyActual,doyExpected)
35-
% testCase.fatalAssertEqual(1,2)
35+
testCase.fatalAssertEqual(1,2)
3636
% fatalAssertEqual(7, 20);
3737
end
3838

src/testResultsSummary.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,32 +118,19 @@ function generateTestFileRow(file: MatlabTestFile): string {
118118
function generateTestCaseRow(testCase: MatlabTestCase): string {
119119
const statusEmoji = getStatusEmoji(testCase.status);
120120
const diagnosticsColumn = testCase.status === MatlabTestStatus.FAILED
121-
? `<details>
122-
<summary>View details</summary>
123-
<table>
124-
<tr>
125-
<th>Actual</th>
126-
<th>Expected</th>
127-
<th>Error</th>
128-
<th>RelativeError</th>
129-
</tr>
130-
<tr>
131-
<td>2.5</td>
132-
<td>3.0</td>
133-
<td>-0.5</td>
134-
<td>-0.167</td>
135-
</tr>
136-
</table>
137-
<pre style="font-family: monospace; white-space: pre;">` + testCase.diagnostics.map(d => formatDiagnosticReport(d.report)).join('') + `</pre>
138-
</details>`
121+
? testCase.diagnostics.map(diagnostic =>
122+
`<details>` +
123+
`<summary>` + diagnostic.event + `</summary>` +
124+
`<pre style="font-family: monospace; white-space: pre;">` + formatDiagnosticReport(diagnostic.report) + `</pre>` +
125+
`</details>`
126+
).join('')
139127
: '';
140128

141-
return `
142-
<tr>
143-
<td>` + statusEmoji + ` ` + testCase.name + `</td>
144-
<td>` + diagnosticsColumn + `</td>
145-
<td align="center">` + testCase.duration.toFixed(2) + `</td>
146-
</tr>`;
129+
return `<tr>` +
130+
`<td>` + statusEmoji + ` ` + testCase.name + `</td>` +
131+
`<td>` + diagnosticsColumn + `</td>` +
132+
`<td align="center">` + testCase.duration.toFixed(2) + `</td>` +
133+
`</tr>`;
147134
}
148135

149136
function formatDiagnosticReport(report: string): string {

0 commit comments

Comments
 (0)