diff options
Diffstat (limited to 'editors/code/src/test/utils/diagnotics')
-rw-r--r-- | editors/code/src/test/utils/diagnotics/rust.test.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/editors/code/src/test/utils/diagnotics/rust.test.ts b/editors/code/src/test/utils/diagnotics/rust.test.ts index 0222dbbaa..9acd319b3 100644 --- a/editors/code/src/test/utils/diagnotics/rust.test.ts +++ b/editors/code/src/test/utils/diagnotics/rust.test.ts | |||
@@ -199,4 +199,38 @@ describe('mapRustDiagnosticToVsCode', () => { | |||
199 | // There are no suggested fixes | 199 | // There are no suggested fixes |
200 | assert.strictEqual(suggestedFixes.length, 0); | 200 | assert.strictEqual(suggestedFixes.length, 0); |
201 | }); | 201 | }); |
202 | |||
203 | it('should map a macro invocation location to normal file path', () => { | ||
204 | const { location, diagnostic, suggestedFixes } = mapFixtureToVsCode( | ||
205 | 'error/E0277', | ||
206 | ); | ||
207 | |||
208 | assert.strictEqual( | ||
209 | diagnostic.severity, | ||
210 | vscode.DiagnosticSeverity.Error, | ||
211 | ); | ||
212 | assert.strictEqual( | ||
213 | diagnostic.message, | ||
214 | [ | ||
215 | 'can\'t compare `{integer}` with `&str`', | ||
216 | 'the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`', | ||
217 | ].join('\n'), | ||
218 | ); | ||
219 | assert.strictEqual(diagnostic.code, 'E0277'); | ||
220 | assert.strictEqual(diagnostic.source, 'rustc'); | ||
221 | assert.deepStrictEqual(diagnostic.tags, []); | ||
222 | |||
223 | // No related information | ||
224 | assert.deepStrictEqual(diagnostic.relatedInformation, []); | ||
225 | |||
226 | // There are no suggested fixes | ||
227 | assert.strictEqual(suggestedFixes.length, 0); | ||
228 | |||
229 | // The file url should be normal file | ||
230 | // Ignore the first part because it depends on vs workspace location | ||
231 | assert.strictEqual( | ||
232 | true, | ||
233 | location.uri.toString().endsWith('src/main.rs'), | ||
234 | ); | ||
235 | }); | ||
202 | }); | 236 | }); |