Skip to content

Commit a452245

Browse files
Make problemMatchers test more robust
By omitting the last part of GNAT messages that lists the switch used to detect the message (e.g: [-gnatwm]). For an unknown reason, this part gets truncated on Windows somehow for one specific message, so let's just skip it: we just want to check that the severities are correctly set for each message. For eng/ide/ada_language_server#1696
1 parent f4964bc commit a452245

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

integration/vscode/ada/test/general/tasks.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,18 @@ ada: Run main - src/test.adb - .${path.sep}obj${path.sep}test${exe}
306306
.filter((diag) => ['ada'].includes(diag.source ?? ''));
307307

308308
assert.equal(
309-
alsDiagnostics.map((d) => `${d.severity}: ${d.message}`).join('\n'),
309+
alsDiagnostics
310+
.map((d) => `${d.severity}: ${d.message.split('[')[0].trim()}`)
311+
.join('\n'),
310312
`
311-
1: procedure "Hello" is not referenced [-gnatwu]
312-
1: bad casing of "Hello" declared at line 4 [-gnatyr]
313-
1: bad casing of "Hello" declared at line 4 [-gnatyr]
314-
1: incorrect layout [-gnatyl]
315-
1: "begin" in wrong column, should be in column 1 [-gnatyl]
316-
1: bad indentation [-gnaty0]
317-
1: possibly useless assignment to "X", value might not be referenced [-gnatwm]
318-
1: "X" may be referenced before it has a value [enabled by default]
313+
1: procedure "Hello" is not referenced
314+
1: bad casing of "Hello" declared at line 4
315+
1: bad casing of "Hello" declared at line 4
316+
1: incorrect layout
317+
1: "begin" in wrong column, should be in column 1
318+
1: bad indentation
319+
1: possibly useless assignment to "X", value might not be referenced
320+
1: "X" may be referenced before it has a value
319321
1: this is a low warning
320322
0: missing ";"
321323
2: this is an extra message

0 commit comments

Comments
 (0)