Skip to content

Commit bb9c60d

Browse files
committed
Use substr instead of endswith
1 parent 63c5930 commit bb9c60d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

editors/code/src/test/utils/diagnotics/rust.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ describe('mapRustDiagnosticToVsCode', () => {
212212
assert.strictEqual(
213213
diagnostic.message,
214214
[
215-
'can\'t compare `{integer}` with `&str`',
215+
"can't compare `{integer}` with `&str`",
216216
'the trait `std::cmp::PartialEq<&str>` is not implemented for `{integer}`',
217217
].join('\n'),
218218
);
@@ -229,8 +229,8 @@ describe('mapRustDiagnosticToVsCode', () => {
229229
// The file url should be normal file
230230
// Ignore the first part because it depends on vs workspace location
231231
assert.strictEqual(
232-
true,
233-
location.uri.toString().endsWith('src/main.rs'),
232+
location.uri.path.substr(-'src/main.rs'.length),
233+
'src/main.rs',
234234
);
235235
});
236236
});

0 commit comments

Comments
 (0)